From 429d53eed8796c01a8d45c88998555128514d9cf Mon Sep 17 00:00:00 2001 From: Doug Blank Date: Mon, 5 Jan 2009 03:57:41 +0000 Subject: [PATCH] Bugfix if no event in Data Entry gramplet svn: r11573 --- src/plugins/DefaultGramplets.py | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/src/plugins/DefaultGramplets.py b/src/plugins/DefaultGramplets.py index af4e0924c..725c55a10 100644 --- a/src/plugins/DefaultGramplets.py +++ b/src/plugins/DefaultGramplets.py @@ -1462,14 +1462,15 @@ class DataEntryGramplet(Gramplet): # look for a match, and possible correction for ref in ref_list: event = self.dbstate.db.get_event_from_handle(ref.ref) - if int(event.get_type()) == type: - # Match! Let's update - if date: - event.set_date_object(date) - if place: - event.set_place_handle(place.get_handle()) - self.dbstate.db.commit_event(event, self.trans) - return (0, event) + if event is not None: + if int(event.get_type()) == type: + # Match! Let's update + if date: + event.set_date_object(date) + if place: + event.set_place_handle(place.get_handle()) + self.dbstate.db.commit_event(event, self.trans) + return (0, event) # else create it: event = gen.lib.Event() if type: