From 33ebd5d0b000e6ee0968c1808207b460a61c21fc Mon Sep 17 00:00:00 2001 From: prculley Date: Sat, 25 Nov 2017 14:53:42 -0600 Subject: [PATCH] Fix HandleError on IsLessThanNthGenerationAncestorOf filters Fixes #10286 --- gramps/gen/filters/rules/person/__init__.py | 1 + .../person/_islessthannthgenerationancestorofbookmarked.py | 2 ++ .../person/_islessthannthgenerationancestorofdefaultperson.py | 2 ++ 3 files changed, 5 insertions(+) diff --git a/gramps/gen/filters/rules/person/__init__.py b/gramps/gen/filters/rules/person/__init__.py index 23834fbc3..cb0ddf0cf 100644 --- a/gramps/gen/filters/rules/person/__init__.py +++ b/gramps/gen/filters/rules/person/__init__.py @@ -187,6 +187,7 @@ editor_rule_list = [ HasNote, HasNoteRegexp, RegExpIdOf, + RegExpName, Disconnected, ChangedSince, IsRelatedWith, diff --git a/gramps/gen/filters/rules/person/_islessthannthgenerationancestorofbookmarked.py b/gramps/gen/filters/rules/person/_islessthannthgenerationancestorofbookmarked.py index ac042e2b7..187f6317d 100644 --- a/gramps/gen/filters/rules/person/_islessthannthgenerationancestorofbookmarked.py +++ b/gramps/gen/filters/rules/person/_islessthannthgenerationancestorofbookmarked.py @@ -80,6 +80,8 @@ class IsLessThanNthGenerationAncestorOfBookmarked(Rule): p = self.db.get_person_from_handle(handle) fam_id = p.get_main_parents_family_handle() + if not fam_id: + return fam = self.db.get_family_from_handle(fam_id) if fam: f_id = fam.get_father_handle() diff --git a/gramps/gen/filters/rules/person/_islessthannthgenerationancestorofdefaultperson.py b/gramps/gen/filters/rules/person/_islessthannthgenerationancestorofdefaultperson.py index 3f78a713c..9f2ae9870 100644 --- a/gramps/gen/filters/rules/person/_islessthannthgenerationancestorofdefaultperson.py +++ b/gramps/gen/filters/rules/person/_islessthannthgenerationancestorofdefaultperson.py @@ -73,6 +73,8 @@ class IsLessThanNthGenerationAncestorOfDefaultPerson(Rule): p = self.db.get_person_from_handle(handle) fam_id = p.get_main_parents_family_handle() + if not fam_id: + return fam = self.db.get_family_from_handle(fam_id) if fam: f_id = fam.get_father_handle()