From 64f97accc0dbb0c7030863a8ef9c721582bdc1af Mon Sep 17 00:00:00 2001 From: Athanasius Date: Thu, 5 Aug 2021 16:22:46 +0100 Subject: [PATCH] plugins/edsm: Only try to send if pending isn't empty This prevents literally sending an empty data to EDSM if we trigger sending due to Shutdown. --- plugins/edsm.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/edsm.py b/plugins/edsm.py index e3f5e902..b0850921 100644 --- a/plugins/edsm.py +++ b/plugins/edsm.py @@ -643,7 +643,7 @@ def worker() -> None: # noqa: CCR001 C901 # Cant be broken up currently pending.append(entry) - if should_send(pending, entry['event']): + if pending and should_send(pending, entry['event']): if 'edsm-cmdr-events' in trace_on: logger.trace(f'({cmdr=}, {entry["event"]=}): should_send() said True') pendings = [f"{p}\n" for p in pending]