1
0
mirror of https://github.com/EDCD/EDMarketConnector.git synced 2025-04-17 17:42:20 +03:00

Merge pull request #1432 from EDCD/fix/1403/eddn-upload-errors

eddn: Log if a 'location' event doesn't have SystemAddress
This commit is contained in:
Athanasius 2022-02-04 12:08:09 +00:00 committed by GitHub
commit 636bcd65bb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1359,7 +1359,14 @@ def journal_entry( # noqa: C901, CCR001
elif this.systemaddress != entry.get('SystemAddress'):
this.coordinates = None # Docked event doesn't include coordinates
this.systemaddress = entry.get('SystemAddress') # type: ignore
if 'SystemAddress' not in entry:
logger.warning(f'"location" event without SystemAddress !!!:\n{entry}\n')
# But we'll still *use* the value, because if a 'location' event doesn't
# have this we've still moved and now don't know where and MUST NOT
# continue to use any old value.
# Yes, explicitly state `None` here, so it's crystal clear.
this.systemaddress = entry.get('SystemAddress', None) # type: ignore
elif entry['event'] == 'ApproachBody':
this.body_name = entry['Body']