From d3be7325660fc032977c8ce234a5d5731495a6f0 Mon Sep 17 00:00:00 2001 From: Dan Albert Date: Fri, 18 Jun 2021 18:14:20 -0700 Subject: [PATCH] Fix tooltips for scuds/silkworms. Same problem as the ground object menu, same cleanup required at some point. --- qt_ui/widgets/map/mapmodel.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/qt_ui/widgets/map/mapmodel.py b/qt_ui/widgets/map/mapmodel.py index 0dadcf15..969726fc 100644 --- a/qt_ui/widgets/map/mapmodel.py +++ b/qt_ui/widgets/map/mapmodel.py @@ -226,7 +226,12 @@ class GroundObjectJs(QObject): if dcs_unit_type is not None: # TODO: Make the TGO contain GroundUnitType instead of the pydcs Group. # This is a hack because we can't know which variant was used. - unit_display_name = next(GroundUnitType.for_dcs_type(dcs_unit_type)).name + try: + unit_display_name = next( + GroundUnitType.for_dcs_type(dcs_unit_type) + ).name + except StopIteration: + pass return f"Unit #{unit.id} - {unit_display_name}{dead_label}" @Property(list, notify=unitsChanged)