HandleError on Relationship view for add child with no father

Fixes #10059.
This commit is contained in:
prculley 2017-05-27 11:28:47 -05:00 committed by Nick Hall
parent eedbe0db67
commit 5f93da1343

View File

@ -1541,8 +1541,9 @@ class RelationshipView(NavigationView):
name.add_surname(Surname())
name.set_primary_surname(0)
family = self.dbstate.db.get_family_from_handle(handle)
father = self.dbstate.db.get_person_from_handle(
family.get_father_handle())
father_h = family.get_father_handle()
if father_h:
father = self.dbstate.db.get_person_from_handle(father_h)
if father:
preset_name(father, name)
person.set_primary_name(name)