9570: crash - 'NoneType' object has no attribute 'get_child_ref_list'
This commit is contained in:
parent
f1156c9627
commit
73eaf011a0
@ -393,6 +393,7 @@ 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)
|
||||||
|
if family:
|
||||||
for child_ref in family.get_child_ref_list():
|
for child_ref in family.get_child_ref_list():
|
||||||
childlist.append(child_ref.ref)
|
childlist.append(child_ref.ref)
|
||||||
return childlist
|
return childlist
|
||||||
@ -522,9 +523,13 @@ 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()
|
||||||
|
if father_handle:
|
||||||
father = db.get_person_from_handle(father_handle)
|
father = db.get_person_from_handle(father_handle)
|
||||||
|
if mother_handle:
|
||||||
mother = db.get_person_from_handle(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)
|
||||||
|
Loading…
Reference in New Issue
Block a user