1
0
Fork 0

Fix a return bug when len(setDicts) is zero.

This commit is contained in:
Curtis L. Olson 2017-09-26 06:26:49 -05:00
parent 7142621966
commit 87c11e7e2f

View file

@ -111,6 +111,7 @@ def scan_aircraft_dir(aircraft_dir, includes):
files = os.listdir(aircraft_dir)
for file in sorted(files, key=lambda s: s.lower()):
if file.endswith('-set.xml'):
# print 'trying:', file
try:
d = scan_set_file(aircraft_dir, file, includes)
if d == None:
@ -126,8 +127,10 @@ def scan_aircraft_dir(aircraft_dir, includes):
elif d['variant-of'] == None:
primaryAircraft.append(d)
print setDicts
if len(setDicts) == 0:
return None
print 'returning none'
return None, None
# use the first one
if len(primaryAircraft) == 0: