From 919e882cd23cb54ffb9eebe0acb04999eafbb861 Mon Sep 17 00:00:00 2001 From: Don Allingham Date: Mon, 30 Oct 2006 00:53:17 +0000 Subject: [PATCH] * src/GrampsDb/_ReadXML.py: handle broken events svn: r7502 --- gramps2/ChangeLog | 1 + gramps2/src/GrampsDb/_ReadXML.py | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/gramps2/ChangeLog b/gramps2/ChangeLog index 082cea1c6..4a425db03 100644 --- a/gramps2/ChangeLog +++ b/gramps2/ChangeLog @@ -1,4 +1,5 @@ 2006-10-29 Don Allingham + * src/GrampsDb/_ReadXML.py: handle broken events * help/C/gramps.xml: fix 2006-10-29 Alex Roitman diff --git a/gramps2/src/GrampsDb/_ReadXML.py b/gramps2/src/GrampsDb/_ReadXML.py index 94f466ba4..95c8d06f4 100644 --- a/gramps2/src/GrampsDb/_ReadXML.py +++ b/gramps2/src/GrampsDb/_ReadXML.py @@ -769,9 +769,13 @@ class GrampsParser(UpdateCallback): self.eventref.private = bool(attrs.get('priv')) if attrs.has_key('role'): self.eventref.role.set_from_xml_str(attrs['role']) + # We count here on events being already parsed prior to parsing # people or families. This code will fail if this is not true. event = self.db.get_event_from_handle(self.eventref.ref) + if not event: + return + if self.family: event.personal = False self.family.add_event_ref(self.eventref)