From 25adf297793fdacb8e2294f46a1b3a679702f2b5 Mon Sep 17 00:00:00 2001 From: A_D Date: Wed, 19 Aug 2020 12:27:15 +0200 Subject: [PATCH] Fixed possible error if credentials is None --- plugins/edsm.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/plugins/edsm.py b/plugins/edsm.py index 766c2dd3..3b12c5ed 100644 --- a/plugins/edsm.py +++ b/plugins/edsm.py @@ -491,7 +491,11 @@ def worker() -> None: if any([p for p in pending if p['event'] in ('CarrierJump', 'FSDJump', 'Location', 'Docked')]): logger.debug('CarrierJump (or FSDJump) in pending and it passed should_send()') - (username, apikey) = credentials(cmdr) # TODO: This raises if credentials returns None + creds = credentials(cmdr) # TODO: possibly unbound + if creds is None: + raise ValueError("Unexpected lack of credentials") + + (username, apikey) = creds data = { 'commanderName': username.encode('utf-8'), 'apiKey': apikey,