From 73eaf011a014af318bc74dbc0c90c98fe35cf160 Mon Sep 17 00:00:00 2001 From: Paul Franklin Date: Mon, 11 Jul 2016 13:53:04 -0700 Subject: [PATCH] 9570: crash - 'NoneType' object has no attribute 'get_child_ref_list' --- gramps/gen/utils/db.py | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/gramps/gen/utils/db.py b/gramps/gen/utils/db.py index 4e0a7f7d5..8725413c8 100644 --- a/gramps/gen/utils/db.py +++ b/gramps/gen/utils/db.py @@ -393,8 +393,9 @@ def find_children(db,p): childlist = [] for family_handle in p.get_family_handle_list(): family = db.get_family_from_handle(family_handle) - for child_ref in family.get_child_ref_list(): - childlist.append(child_ref.ref) + if family: + for child_ref in family.get_child_ref_list(): + childlist.append(child_ref.ref) return childlist #------------------------------------------------------------------------- @@ -522,10 +523,14 @@ def preset_name(basepers, name, sibling=False): def family_name(family, db, noname=_("unknown")): """Builds a name for the family from the parents names""" + father = None + mother = None father_handle = family.get_father_handle() mother_handle = family.get_mother_handle() - father = db.get_person_from_handle(father_handle) - mother = db.get_person_from_handle(mother_handle) + if father_handle: + father = db.get_person_from_handle(father_handle) + if mother_handle: + mother = db.get_person_from_handle(mother_handle) if father and mother: fname = name_displayer.display(father) mname = name_displayer.display(mother)