Fix error displaying flight edit dialog.

If no airfield was selected (as sometimes happens, usually when there
are no aircraft available anywhere), report that no aircraft are
available.
This commit is contained in:
Dan Albert 2020-10-31 18:33:45 -07:00
parent b6421646ff
commit d94c57afd6

View File

@ -43,5 +43,7 @@ class QOriginAirfieldSelector(QComboBox):
@property
def available(self) -> int:
origin = self.currentData()
if origin is None:
return 0
inventory = self.global_inventory.for_control_point(origin)
return inventory.available(self.aircraft)