Bugfix if no event in Data Entry gramplet

svn: r11573
This commit is contained in:
Doug Blank 2009-01-05 03:57:41 +00:00
parent fe3d9d6b0e
commit 429d53eed8

View File

@ -1462,14 +1462,15 @@ class DataEntryGramplet(Gramplet):
# look for a match, and possible correction # look for a match, and possible correction
for ref in ref_list: for ref in ref_list:
event = self.dbstate.db.get_event_from_handle(ref.ref) event = self.dbstate.db.get_event_from_handle(ref.ref)
if int(event.get_type()) == type: if event is not None:
# Match! Let's update if int(event.get_type()) == type:
if date: # Match! Let's update
event.set_date_object(date) if date:
if place: event.set_date_object(date)
event.set_place_handle(place.get_handle()) if place:
self.dbstate.db.commit_event(event, self.trans) event.set_place_handle(place.get_handle())
return (0, event) self.dbstate.db.commit_event(event, self.trans)
return (0, event)
# else create it: # else create it:
event = gen.lib.Event() event = gen.lib.Event()
if type: if type: