2352: 'NoneType' object has no attribute 'get_family_handle_list'

svn: r12805
This commit is contained in:
Benny Malengier 2009-07-16 12:40:52 +00:00
parent b294f3608b
commit c207cf819b

View File

@ -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 = []
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]
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"
#------------------------------------------------------------------------
#