]> git.mxchange.org Git - fba.git/commitdiff
Continued:
authorRoland Häder <roland@mxchange.org>
Sun, 22 Oct 2023 04:28:48 +0000 (06:28 +0200)
committerRoland Häder <roland@mxchange.org>
Sun, 22 Oct 2023 04:28:48 +0000 (06:28 +0200)
- skip empty domain names before is_wanted() is invocated

fba/networks/misskey.py
fba/networks/pleroma.py

index b57c252711c7e02fe55e1d1f15301076449ea351..045b5061c807fa4547802e26edcef8243e4b31b5 100644 (file)
@@ -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):
index b4e98fe1e855e6b160474465dcbba0f255b8e8d0..9e4eeb3b0091c73e08e79c6c84acdc19cb70c7be 100644 (file)
@@ -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