]> git.mxchange.org Git - fba.git/commitdiff
Continued:
authorRoland Häder <roland@mxchange.org>
Sat, 1 Jul 2023 00:17:30 +0000 (02:17 +0200)
committerRoland Häder <roland@mxchange.org>
Sat, 1 Jul 2023 00:17:30 +0000 (02:17 +0200)
- fixed exception when pleroma block reason is None

fba/networks/pleroma.py

index 60822825865f4a779312a500a361b9020be805bf..49ec65bea9daf265e3c37bde762a48ed6d5fefd3 100644 (file)
@@ -198,7 +198,7 @@ def fetch_blocks(domain: str, nodeinfo_url: str) -> list:
                     reason = tidyup.reason(reason)
                 elif isinstance(reason, dict) and "reason" in reason:
                     logger.debug("reason[] is a dict")
-                    reason = tidyup.reason(reason["reason"])
+                    reason = tidyup.reason(reason["reason"]) if isinstance(reason["reason"], str) else None
                 elif reason is not None:
                     raise ValueError(f"Cannot handle reason[]='{type(reason)}'")