From 2bf70aae14bbea7ff2876ad6c474e9e2091f59fe Mon Sep 17 00:00:00 2001 From: Athanasius Date: Tue, 1 Feb 2022 16:59:44 +0000 Subject: [PATCH] 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. --- plugins/eddn.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/plugins/eddn.py b/plugins/eddn.py index ea80404f..39c28eb5 100644 --- a/plugins/eddn.py +++ b/plugins/eddn.py @@ -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.