From 2bbda30097604f670ace98f42b37879176e4c020 Mon Sep 17 00:00:00 2001 From: Athanasius Date: Thu, 1 Dec 2022 13:33:26 +0000 Subject: [PATCH] Inara: Drop addCommanderCombatInterdicted if empty opponentName Addresses #1732 specifically. At some point #1433 needs fully addressing (review all Inara API code for compliance with docs). --- plugins/inara.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/plugins/inara.py b/plugins/inara.py index 1a7cf1f6..5783b692 100644 --- a/plugins/inara.py +++ b/plugins/inara.py @@ -1069,7 +1069,11 @@ def journal_entry( # noqa: C901, CCR001 elif 'Power' in entry: data['opponentName'] = entry['Power'] - new_add_event('addCommanderCombatInterdicted', entry['timestamp'], data) + if data['opponentName'] == "": + logger.warning('Dropping addCommanderCombatInterdicted message because opponentName came out as ""') + + else: + new_add_event('addCommanderCombatInterdicted', entry['timestamp'], data) elif event_name == 'Interdiction': data = OrderedDict([