From a54c217f8855c3c152820f848c8218080c810152 Mon Sep 17 00:00:00 2001 From: Raffson Date: Mon, 18 Jul 2022 03:21:35 +0200 Subject: [PATCH] Guard against null squadron in flight creator. Fixes https://github.com/dcs-liberation/dcs_liberation/issues/2323 --- qt_ui/windows/mission/flight/QFlightCreator.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/qt_ui/windows/mission/flight/QFlightCreator.py b/qt_ui/windows/mission/flight/QFlightCreator.py index 3383e790..1ffa8f0e 100644 --- a/qt_ui/windows/mission/flight/QFlightCreator.py +++ b/qt_ui/windows/mission/flight/QFlightCreator.py @@ -115,9 +115,7 @@ class QFlightCreator(QDialog): tooltip="Selects the start type for this flight.", ) ) - squadron: Squadron = self.squadron_selector.currentData() - home_base: ControlPoint = squadron.location - if isinstance(home_base, OffMapSpawn): + if squadron is not None and isinstance(squadron.location, OffMapSpawn): self.start_type.setCurrentText(StartType.IN_FLIGHT.value) self.start_type.setEnabled(False) layout.addWidget(