From 87193b4a510c4f8f4c11012dea74c4b294506a23 Mon Sep 17 00:00:00 2001
From: Athanasius <github@miggy.org>
Date: Tue, 1 Feb 2022 15:43:42 +0000
Subject: [PATCH] eddn: Be more paranoid about system name augmentation

---
 plugins/eddn.py | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/plugins/eddn.py b/plugins/eddn.py
index d58eac26..ee8a52dd 100644
--- a/plugins/eddn.py
+++ b/plugins/eddn.py
@@ -802,7 +802,12 @@ class EDDN:
         # If 'SystemName' or 'System' is there, it's directly from a journal event.
         # If they're not there *and* 'StarSystem' isn't either, then we add the latter.
         if 'SystemName' not in entry and 'System' not in entry and 'StarSystem' not in entry:
-            entry['StarSystem'] = system_name
+            if system_name is not None and system_name != '':
+                entry['StarSystem'] = system_name
+
+            else:
+                # Bad assumptions if this is the case
+                logger.error(f'No system name in entry, and system_name was not set either!  entry:\n{entry!r}\n')
 
         if 'SystemAddress' not in entry:
             if this.systemaddress is None: