2352: 'NoneType' object has no attribute 'get_family_handle_list'
svn: r12805
This commit is contained in:
parent
b294f3608b
commit
c207cf819b
@ -79,7 +79,7 @@ def _validate_options(options, dbase):
|
||||
phandle = dbase.get_person_handles()[0]
|
||||
person = dbase.get_person_from_handle(phandle)
|
||||
if not person:
|
||||
print "Please specify a person"
|
||||
print "ERROR: Please specify a person"
|
||||
if person:
|
||||
option.set_value(person.get_gramps_id())
|
||||
|
||||
@ -88,13 +88,22 @@ def _validate_options(options, dbase):
|
||||
family = dbase.get_family_from_gramps_id(fid)
|
||||
if not family:
|
||||
person = dbase.get_default_person()
|
||||
family_list = person.get_family_handle_list()
|
||||
family_list = []
|
||||
family_handle = None
|
||||
if person:
|
||||
family_list = person.get_family_handle_list()
|
||||
if family_list:
|
||||
family_handle = family_list[0]
|
||||
else:
|
||||
family_handle = dbase.get_family_handles()[0]
|
||||
family = dbase.get_family_from_handle(family_handle)
|
||||
option.set_value(family.get_gramps_id())
|
||||
flist = dbase.get_family_handles()
|
||||
if flist:
|
||||
family_handle = flist[0]
|
||||
if family_handle:
|
||||
family = dbase.get_family_from_handle(family_handle)
|
||||
option.set_value(family.get_gramps_id())
|
||||
else:
|
||||
print "ERROR: Please specify a family"
|
||||
|
||||
|
||||
#------------------------------------------------------------------------
|
||||
#
|
||||
|
Loading…
x
Reference in New Issue
Block a user