diff --git a/ChangeLog b/ChangeLog index 082cea1c6..4a425db03 100644 --- a/ChangeLog +++ b/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/src/GrampsDb/_ReadXML.py b/src/GrampsDb/_ReadXML.py index 94f466ba4..95c8d06f4 100644 --- a/src/GrampsDb/_ReadXML.py +++ b/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)