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 committed 2022-02-01 16:59:44 +00:00
1 parent 4fa64eec40
commit 2bf70aae14
1 file changed
+5 -1
+5 -1
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.