From cce2be25777304c4432569104214c264736f717b Mon Sep 17 00:00:00 2001 From: Till Skrodzki Date: Sun, 21 Jan 2024 10:40:16 +0100 Subject: [PATCH] Return None is string cannot be decoded --- .../mitm_data/holder/latest_mitm_data/LatestMitmDataEntry.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/mapadroid/data_handler/mitm_data/holder/latest_mitm_data/LatestMitmDataEntry.py b/mapadroid/data_handler/mitm_data/holder/latest_mitm_data/LatestMitmDataEntry.py index cee7615c3..dfb430e43 100644 --- a/mapadroid/data_handler/mitm_data/holder/latest_mitm_data/LatestMitmDataEntry.py +++ b/mapadroid/data_handler/mitm_data/holder/latest_mitm_data/LatestMitmDataEntry.py @@ -41,7 +41,10 @@ async def from_json(json_data: Union[bytes, str]) -> Optional[LatestMitmDataEntr if not raw_data: return None elif isinstance(raw_data, str): - data: Union[List, Dict, bytes] = base64.b64decode(raw_data) + try: + data: Union[List, Dict, bytes] = base64.b64decode(raw_data) + except Exception: + return None else: data: Union[List, Dict, bytes] = raw_data obj: LatestMitmDataEntry = LatestMitmDataEntry(location,