diff --git a/src/Filters/Rules/Person/_HasCommonAncestorWith.py b/src/Filters/Rules/Person/_HasCommonAncestorWith.py index 3086278e0..3b1196831 100644 --- a/src/Filters/Rules/Person/_HasCommonAncestorWith.py +++ b/src/Filters/Rules/Person/_HasCommonAncestorWith.py @@ -75,15 +75,19 @@ class HasCommonAncestorWith(Rule): return for fam_handle in person.get_parent_family_handle_list(): + parentless_fam = True fam = db.get_family_from_handle(fam_handle) if fam: for par_handle in (fam.get_father_handle(), fam.get_mother_handle()): if par_handle: + parentless_fam = False par = db.get_person_from_handle(par_handle) if par and par.handle not in self.ancestor_cache: self.add_ancs(db, par) if par: self.ancestor_cache[person.handle] |= self.ancestor_cache[par.handle] + if parentless_fam: + self.ancestor_cache[person.handle].add(fam_handle) def reset(self): self.ancestor_cache = {}