Bug [0003123]: [Gedcom] An empty type on event may break import

svn: r12849
This commit is contained in:
Gerald Britton 2009-07-29 13:42:19 +00:00
parent 99e17ea98e
commit 283f46d543

View File

@ -1164,7 +1164,7 @@ class GedcomParser(UpdateCallback):
line.data.startswith("SOURCE "): line.data.startswith("SOURCE "):
# A source formatted in a single line, for example: # A source formatted in a single line, for example:
# 0 @S62@ SOUR This is the title of the source # 0 @S62@ SOUR This is the title of the source
source = self.__find_or_create_source(self.sid_map[line[3]]) source = self.__find_or_create_source(self.sid_map[line.data])
source.set_title(line.data[5:]) source.set_title(line.data[5:])
self.dbase.commit_source(source, self.trans) self.dbase.commit_source(source, self.trans)
elif key[0:4] == "NOTE": elif key[0:4] == "NOTE":
@ -2727,7 +2727,7 @@ class GedcomParser(UpdateCallback):
else: else:
try: try:
name = gen.lib.EventType((gen.lib.EventType.CUSTOM, name = gen.lib.EventType((gen.lib.EventType.CUSTOM,
line[3])) line.data))
except AttributeError: except AttributeError:
name = gen.lib.EventType(gen.lib.EventType.UNKNOWN) name = gen.lib.EventType(gen.lib.EventType.UNKNOWN)
state.event.set_type(name) state.event.set_type(name)