9570: crash - 'NoneType' object has no attribute 'get_child_ref_list'
This commit is contained in:
parent
f1156c9627
commit
73eaf011a0
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user