From 3fb1e0fd4a31e6e041cf90f92558a43e644d8f2b Mon Sep 17 00:00:00 2001 From: Doug Blank Date: Sat, 25 Sep 2010 11:00:25 +0000 Subject: [PATCH] Two more fixes for protecting None.property when using Do Not Include Unlinked records svn: r15929 --- src/plugins/export/ExportGedcom.py | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/src/plugins/export/ExportGedcom.py b/src/plugins/export/ExportGedcom.py index bc34eb454..85369ad6d 100644 --- a/src/plugins/export/ExportGedcom.py +++ b/src/plugins/export/ExportGedcom.py @@ -609,6 +609,8 @@ class GedcomWriter(UpdateCallback): """ for event_ref in person.get_event_ref_list(): event = self.dbase.get_event_from_handle(event_ref.ref) + if event is None: + continue etype = int(event.get_type()) # if the event is a birth or death, skip it. @@ -1106,13 +1108,14 @@ class GedcomWriter(UpdateCallback): """ if event_ref: event = self.dbase.get_event_from_handle(event_ref.ref) - if event_has_subordinate_data(event, event_ref): - self.__writeln(1, key) - else: - self.__writeln(1, key, 'Y') - if event.get_description().strip() != "": - self.__writeln(2, 'TYPE', event.get_description()) - self.__dump_event_stats(event, event_ref) + if event: + if event_has_subordinate_data(event, event_ref): + self.__writeln(1, key) + else: + self.__writeln(1, key, 'Y') + if event.get_description().strip() != "": + self.__writeln(2, 'TYPE', event.get_description()) + self.__dump_event_stats(event, event_ref) def __change(self, timeval, level): """