Protection from family_handle being None

This commit is contained in:
Doug Blank 2016-09-22 16:25:53 -04:00
parent 899765beb6
commit c6fa40d389

View File

@ -66,14 +66,15 @@ class IsDuplicatedAncestorOf(Rule):
def init_ancestor_list(self, db, person): def init_ancestor_list(self, db, person):
fam_id = person.get_main_parents_family_handle() fam_id = person.get_main_parents_family_handle()
fam = db.get_family_from_handle(fam_id) if fam_id:
if fam: fam = db.get_family_from_handle(fam_id)
f_id = fam.get_father_handle() if fam:
m_id = fam.get_mother_handle() f_id = fam.get_father_handle()
if m_id: m_id = fam.get_mother_handle()
self.mother_side(db, db.get_person_from_handle(m_id)) if m_id:
if f_id: self.mother_side(db, db.get_person_from_handle(m_id))
self.father_side(db, db.get_person_from_handle(f_id)) if f_id:
self.father_side(db, db.get_person_from_handle(f_id))
def mother_side(self, db, person): def mother_side(self, db, person):
if person and person.handle in self.map: if person and person.handle in self.map: