1
0
mirror of https://github.com/EDCD/EDMarketConnector.git synced 2025-04-15 00:30:33 +03:00

Fixed possible error if credentials is None

This commit is contained in:
A_D 2020-08-19 12:27:15 +02:00
parent 2c2ade05e0
commit 25adf29779
No known key found for this signature in database
GPG Key ID: 4BE9EB7DF45076C4

View File

@ -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,