Fix IsEnclosedBy rule for non-existent places
This commit is contained in:
parent
640101c13a
commit
741d192f1f
@ -51,9 +51,14 @@ class IsEnclosedBy(Rule):
|
|||||||
category = _('General filters')
|
category = _('General filters')
|
||||||
|
|
||||||
def prepare(self, db):
|
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):
|
def apply(self, db, place):
|
||||||
|
if self.handle is None:
|
||||||
|
return False
|
||||||
if located_in(db, place.handle, self.handle):
|
if located_in(db, place.handle, self.handle):
|
||||||
return True
|
return True
|
||||||
return False
|
return False
|
||||||
|
Loading…
Reference in New Issue
Block a user