Fix IsEnclosedBy rule for non-existent places
This commit is contained in:
parent
01536e4b50
commit
0ad17ac27f
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user