diff --git a/gramps/gen/filters/rules/person/_deeprelationshippathbetween.py b/gramps/gen/filters/rules/person/_deeprelationshippathbetween.py index f37f587e2..15be87219 100644 --- a/gramps/gen/filters/rules/person/_deeprelationshippathbetween.py +++ b/gramps/gen/filters/rules/person/_deeprelationshippathbetween.py @@ -68,7 +68,7 @@ def get_family_handle_people(db, exclude_handle, family_handle): def possibly_add_handle(h): if h != None and h != exclude_handle: - people.add(db.get_person_from_handle(h)) + people.add(h) possibly_add_handle(family.get_father_handle()) possibly_add_handle(family.get_mother_handle()) @@ -95,6 +95,9 @@ def find_deep_relations(db, progress, person, path, seen, target_people): if len(target_people) < 1: return [] + if person is None: + return [] + handle = person.get_handle() if handle in seen: return [] @@ -109,7 +112,8 @@ def find_deep_relations(db, progress, person, path, seen, target_people): family_people = get_person_family_people(db, person, handle) for family_person in family_people: - return_paths += find_deep_relations(db, progress, family_person, person_path, seen, target_people) + pers = db.get_person_from_handle(family_person) + return_paths += find_deep_relations(db, progress, pers, person_path, seen, target_people) if progress: progress.step() return return_paths