* src/GenericFilter.py (HasCommonAncestorWith): Catch no longer existing person

svn: r5437
This commit is contained in:
Martin Hawlisch 2005-11-25 16:39:51 +00:00
parent 63c4ca9553
commit f221703095
2 changed files with 10 additions and 4 deletions

View File

@ -1,3 +1,6 @@
2005-11-25 Martin Hawlisch <Martin.Hawlisch@gmx.de>
* src/GenericFilter.py (HasCommonAncestorWith): Catch no longer existing person
2005-11-24 Don Allingham <don@gramps-project.org>
* src/po/template.po: updated translation file

View File

@ -927,10 +927,13 @@ class HasCommonAncestorWith(Rule):
def init_ancestor_cache(self,db):
# list[0] is an Id, but we need to pass a Person to for_each_ancestor.
handle = db.get_person_from_gramps_id(self.list[0]).get_handle()
if handle:
def init(self,handle): self.ancestor_cache[handle] = 1
for_each_ancestor(db,[handle],init,self)
try:
handle = db.get_person_from_gramps_id(self.list[0]).get_handle()
if handle:
def init(self,handle): self.ancestor_cache[handle] = 1
for_each_ancestor(db,[handle],init,self)
except:
pass
def apply(self,db,person):
# On the first call, we build the ancestor cache for the