* src/GrampsDb/_ReadXML.py: handle broken events

svn: r7502
This commit is contained in:
Don Allingham 2006-10-30 00:53:17 +00:00
parent 96ffe8abb0
commit 8ef02aeb20
2 changed files with 5 additions and 0 deletions

View File

@ -1,4 +1,5 @@
2006-10-29 Don Allingham <don@gramps-project.org>
* src/GrampsDb/_ReadXML.py: handle broken events
* help/C/gramps.xml: fix <warning>
2006-10-29 Alex Roitman <shura@gramps-project.org>

View File

@ -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)