From: Roland Häder Date: Sun, 22 Oct 2023 04:28:48 +0000 (+0200) Subject: Continued: X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=5a01e3a0e522038671d0a8ad83038f11ac6c99d1;p=fba.git Continued: - skip empty domain names before is_wanted() is invocated --- diff --git a/fba/networks/misskey.py b/fba/networks/misskey.py index b57c252..045b506 100644 --- a/fba/networks/misskey.py +++ b/fba/networks/misskey.py @@ -288,7 +288,10 @@ def fetch_blocks(domain: str) -> list: blocked = tidyup.domain(instance["host"]) logger.debug("blocked='%s'", blocked) - if not domain_helper.is_wanted(blocked): + if blocked is None or blocked == "": + logger.warning("instance[host]='%s' is None or empty after tidyup.domain() - SKIPPED!", instance["host"]) + continue + elif not domain_helper.is_wanted(blocked): logger.debug("blocked='%s' is not wanted - SKIPPED!", blocked) continue elif "isBlocked" in instance and instance["isBlocked"] and not dict_helper.has_key(blocklist, "blocked", blocked): diff --git a/fba/networks/pleroma.py b/fba/networks/pleroma.py index b4e98fe..9e4eeb3 100644 --- a/fba/networks/pleroma.py +++ b/fba/networks/pleroma.py @@ -135,7 +135,10 @@ def fetch_blocks(domain: str) -> list: blocked = utils.deobfuscate(blocked, domain) logger.debug("blocked='%s' - DEOBFUSCATED!", blocked) - if not domain_helper.is_wanted(blocked): + if blocked is None or blocked == "": + logger.warning("instance[host]='%s' is None or empty after tidyup.domain() - SKIPPED!", instance["host"]) + continue + elif not domain_helper.is_wanted(blocked): logger.debug("blocked='%s' is not wanted - SKIPPED!", blocked) continue