Update import to cope with missing place name and type

This commit is contained in:
Nick Hall 2015-02-02 17:32:15 +00:00
parent 643ffcb479
commit 55c7becb68

View File

@ -1150,8 +1150,9 @@ class GrampsParser(UpdateCallback):
self.placeobj.private = bool(attrs.get("priv")) self.placeobj.private = bool(attrs.get("priv"))
self.placeobj.change = int(attrs.get('change', self.change)) self.placeobj.change = int(attrs.get('change', self.change))
if self.__xml_version >= (1, 6, 0): if self.__xml_version >= (1, 6, 0):
self.placeobj.name = attrs.get("name") self.placeobj.name = attrs.get('name', '')
self.placeobj.place_type.set_from_xml_str(attrs.get("type")) if 'type' in attrs:
self.placeobj.place_type.set_from_xml_str(attrs.get('type'))
self.info.add('new-object', PLACE_KEY, self.placeobj) self.info.add('new-object', PLACE_KEY, self.placeobj)
# GRAMPS LEGACY: title in the placeobj tag # GRAMPS LEGACY: title in the placeobj tag