From 741d192f1fffac6046f5195db141907f300082ae Mon Sep 17 00:00:00 2001 From: Nick Hall Date: Sun, 28 Jun 2015 19:11:42 +0100 Subject: [PATCH] Fix IsEnclosedBy rule for non-existent places --- gramps/gen/filters/rules/place/_isenclosedby.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/gramps/gen/filters/rules/place/_isenclosedby.py b/gramps/gen/filters/rules/place/_isenclosedby.py index 5fb8e6d9d..6c445ebf0 100644 --- a/gramps/gen/filters/rules/place/_isenclosedby.py +++ b/gramps/gen/filters/rules/place/_isenclosedby.py @@ -51,9 +51,14 @@ class IsEnclosedBy(Rule): category = _('General filters') def prepare(self, db): - self.handle = db.get_place_from_gramps_id(self.list[0]).handle + self.handle = None + place = db.get_place_from_gramps_id(self.list[0]) + if place: + self.handle = place.handle def apply(self, db, place): + if self.handle is None: + return False if located_in(db, place.handle, self.handle): return True return False