1
0
mirror of https://github.com/EDCD/EDMarketConnector.git synced 2025-05-30 07:09:39 +03:00

eddn: Be paranoid about this.status_body_name type and value

As it was we'd blindly set codexentry['BodyName'] from it if not None.
This commit is contained in:
Athanasius 2022-02-01 16:59:44 +00:00
parent 4fa64eec40
commit 2bf70aae14
No known key found for this signature in database
GPG Key ID: AE3E527847057C7D

View File

@ -943,7 +943,11 @@ class EDDN:
entry = ret
# Set BodyName if it's available from Status.json
if this.status_body_name is not None:
if this.status_body_name is None or not isinstance(this.status_body_name, str):
logger.warning(f'this.status_body_name was not set properly:'
f' "{this.status_body_name}" ({type(this.status_body_name)})')
else:
entry['BodyName'] = this.status_body_name
# Only set BodyID if journal BodyName matches the Status.json one.
# This avoids binary body issues.