diff --git a/src/gen/proxy/proxybase.py b/src/gen/proxy/proxybase.py index c1f19775c..0a7e188d0 100644 --- a/src/gen/proxy/proxybase.py +++ b/src/gen/proxy/proxybase.py @@ -306,7 +306,7 @@ class ProxyDbBase(DbReadBase): """ Returns obj if predicate is True or not callable, else returns None """ - if predicate is not None: + if predicate is not None and obj is not None: return obj if predicate(obj.handle) else None return obj diff --git a/src/plugins/export/ExportGedcom.py b/src/plugins/export/ExportGedcom.py index d2ac09a8a..731520781 100644 --- a/src/plugins/export/ExportGedcom.py +++ b/src/plugins/export/ExportGedcom.py @@ -1286,6 +1286,8 @@ class GedcomWriter(UpdateCallback): return src = self.dbase.get_source_from_handle(src_handle) + if src is None: + return # Reference to the source self.__writeln(level, "SOUR", "@%s@" % src.get_gramps_id())