From 9baebeebf8160630afde0a95c2b813838ba8963f Mon Sep 17 00:00:00 2001 From: zhexu14 <64713351+zhexu14@users.noreply.github.com> Date: Sat, 14 Jun 2025 18:15:48 +1000 Subject: [PATCH] Check if callsign is None before releasing to handle scenario where callsign was never generated correctly (#3510) This PR is a workaround for modules where the standard callsigns (Ford, Uzi etc) are not supported. Callsigns are not generated correctly and a crash occurs when trying to release them if a package is released. --- qt_ui/models.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/qt_ui/models.py b/qt_ui/models.py index 441fa1dc..f968605b 100644 --- a/qt_ui/models.py +++ b/qt_ui/models.py @@ -312,9 +312,12 @@ class AtoModel(QAbstractListModel): index = self.ato.packages.index(package) self.beginRemoveRows(QModelIndex(), index, index) for flight in package.flights: - self.game_model.game.blue.callsign_generator.release_callsign( - flight.callsign - ) + # Check if flight.callsign is None to handle case where callsign was not generated. + # This can happen when a module does not support the standard callsigns e.g. Kiowa. + if flight.callsign is not None: + self.game_model.game.blue.callsign_generator.release_callsign( + flight.callsign + ) self.ato.remove_package(package) self.endRemoveRows() # noinspection PyUnresolvedReferences