From ded6869a2a32942e34c3100503401d7bc8cd2ab9 Mon Sep 17 00:00:00 2001 From: Nick Hall Date: Fri, 11 Dec 2015 18:29:54 +0000 Subject: [PATCH] Check for empty handle in private proxy --- gramps/gen/proxy/private.py | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/gramps/gen/proxy/private.py b/gramps/gen/proxy/private.py index d486b428a..ac3ed0459 100644 --- a/gramps/gen/proxy/private.py +++ b/gramps/gen/proxy/private.py @@ -647,9 +647,10 @@ def sanitize_lds_ord(db, lds_ord): new_lds_ord.set_date_object(lds_ord.get_date_object()) place_handle = lds_ord.get_place_handle() - place = db.get_place_from_handle(place_handle) - if place and not place.get_privacy(): - new_lds_ord.set_place_handle(place_handle) + if place_handle: + place = db.get_place_from_handle(place_handle) + if place and not place.get_privacy(): + new_lds_ord.set_place_handle(place_handle) copy_citation_ref_list(db, lds_ord, new_lds_ord) copy_notes(db, lds_ord, new_lds_ord) @@ -1020,9 +1021,10 @@ def sanitize_event(db, event): copy_attributes(db, event, new_event) place_handle = event.get_place_handle() - place = db.get_place_from_handle(place_handle) - if place and not place.get_privacy(): - new_event.set_place_handle(place_handle) + if place_handle: + place = db.get_place_from_handle(place_handle) + if place and not place.get_privacy(): + new_event.set_place_handle(place_handle) return new_event