5449: Pedigree view crashes if you happen to choose a child as ancestor

This commit is contained in:
SNoiraud 2016-05-03 13:25:23 +02:00
parent 099e88eef3
commit 9ab7b6cfc1

View File

@ -1665,7 +1665,9 @@ class PedigreeView(NavigationView):
sp_id = family.get_mother_handle()
else:
sp_id = family.get_father_handle()
spouse = self.dbstate.db.get_person_from_handle(sp_id)
spouse = None
if sp_id:
spouse = self.dbstate.db.get_person_from_handle(sp_id)
if not spouse:
continue
@ -1780,7 +1782,9 @@ class PedigreeView(NavigationView):
no_parents = 1
par_list = find_parents(self.dbstate.db, person)
for par_id in par_list:
par = self.dbstate.db.get_person_from_handle(par_id)
par = None
if par_id:
par = self.dbstate.db.get_person_from_handle(par_id)
if not par:
continue