From ec549b3d691196fa6e61490f4ce5ae53ba0be69a Mon Sep 17 00:00:00 2001 From: Martin Hawlisch Date: Tue, 19 Apr 2005 19:33:56 +0000 Subject: [PATCH] * GenericFilter.py: Don't crash on corrupt database svn: r4381 --- gramps2/ChangeLog | 3 +++ gramps2/src/GenericFilter.py | 4 +++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/gramps2/ChangeLog b/gramps2/ChangeLog index 9a1fdda2b..3b77bc716 100644 --- a/gramps2/ChangeLog +++ b/gramps2/ChangeLog @@ -1,3 +1,6 @@ +2005-04-19 Martin Hawlisch + * GenericFilter.py: Don't crash on corrupt database + 2005-04-19 Eero Tamminen * src/GenericFilter.py: Fix typo * src/ReportUtils.py: Fix typos diff --git a/gramps2/src/GenericFilter.py b/gramps2/src/GenericFilter.py index ce50729f7..a2d71cdcc 100644 --- a/gramps2/src/GenericFilter.py +++ b/gramps2/src/GenericFilter.py @@ -1950,7 +1950,7 @@ class HasTextMatchingSubstringOf(Rule): event = self.db.get_event_from_handle(event_handle) if self.match_object(event): match = 1 - else: + elif event: place_handle = event.get_place_handle() if place_handle: if self.search_place(place_handle): @@ -1985,6 +1985,8 @@ class HasTextMatchingSubstringOf(Rule): self.place_map[handle] = 1 def match_object(self,obj): + if not obj: + return 0 if self.regexp_match: return obj.matches_regexp(self.list[0],self.case_sensitive) return obj.matches_string(self.list[0],self.case_sensitive)