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 = []
|
childlist = []
|
||||||
for family_handle in p.get_family_handle_list():
|
for family_handle in p.get_family_handle_list():
|
||||||
family = db.get_family_from_handle(family_handle)
|
family = db.get_family_from_handle(family_handle)
|
||||||
for child_ref in family.get_child_ref_list():
|
if family:
|
||||||
childlist.append(child_ref.ref)
|
for child_ref in family.get_child_ref_list():
|
||||||
|
childlist.append(child_ref.ref)
|
||||||
return childlist
|
return childlist
|
||||||
|
|
||||||
#-------------------------------------------------------------------------
|
#-------------------------------------------------------------------------
|
||||||
@ -522,10 +523,14 @@ def preset_name(basepers, name, sibling=False):
|
|||||||
def family_name(family, db, noname=_("unknown")):
|
def family_name(family, db, noname=_("unknown")):
|
||||||
"""Builds a name for the family from the parents names"""
|
"""Builds a name for the family from the parents names"""
|
||||||
|
|
||||||
|
father = None
|
||||||
|
mother = None
|
||||||
father_handle = family.get_father_handle()
|
father_handle = family.get_father_handle()
|
||||||
mother_handle = family.get_mother_handle()
|
mother_handle = family.get_mother_handle()
|
||||||
father = db.get_person_from_handle(father_handle)
|
if father_handle:
|
||||||
mother = db.get_person_from_handle(mother_handle)
|
father = db.get_person_from_handle(father_handle)
|
||||||
|
if mother_handle:
|
||||||
|
mother = db.get_person_from_handle(mother_handle)
|
||||||
if father and mother:
|
if father and mother:
|
||||||
fname = name_displayer.display(father)
|
fname = name_displayer.display(father)
|
||||||
mname = name_displayer.display(mother)
|
mname = name_displayer.display(mother)
|
||||||
|
Loading…
Reference in New Issue
Block a user