From c6fa40d389b19d2198acf37794d5cefc57ccd43b Mon Sep 17 00:00:00 2001 From: Doug Blank Date: Thu, 22 Sep 2016 16:25:53 -0400 Subject: [PATCH] Protection from family_handle being None --- .../rules/person/_isduplicatedancestorof.py | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/gramps/gen/filters/rules/person/_isduplicatedancestorof.py b/gramps/gen/filters/rules/person/_isduplicatedancestorof.py index 33f270d03..f5c97eeec 100644 --- a/gramps/gen/filters/rules/person/_isduplicatedancestorof.py +++ b/gramps/gen/filters/rules/person/_isduplicatedancestorof.py @@ -66,14 +66,15 @@ class IsDuplicatedAncestorOf(Rule): def init_ancestor_list(self, db, person): fam_id = person.get_main_parents_family_handle() - fam = db.get_family_from_handle(fam_id) - if fam: - f_id = fam.get_father_handle() - m_id = fam.get_mother_handle() - if m_id: - self.mother_side(db, db.get_person_from_handle(m_id)) - if f_id: - self.father_side(db, db.get_person_from_handle(f_id)) + if fam_id: + fam = db.get_family_from_handle(fam_id) + if fam: + f_id = fam.get_father_handle() + m_id = fam.get_mother_handle() + if m_id: + self.mother_side(db, db.get_person_from_handle(m_id)) + if f_id: + self.father_side(db, db.get_person_from_handle(f_id)) def mother_side(self, db, person): if person and person.handle in self.map: