]> git.mxchange.org Git - fba.git/commitdiff
Continued:
authorRoland Häder <roland@mxchange.org>
Thu, 13 Jul 2023 10:46:52 +0000 (12:46 +0200)
committerRoland Häder <roland@mxchange.org>
Thu, 13 Jul 2023 10:46:52 +0000 (12:46 +0200)
- check if dict 'row' has key 'hostname'

fba/commands.py

index b96ab65af33bddc74f0b4567687645c10f4d4e62..47d21ed4e10e68a6d2d35561790d3d1ebab25cd1 100644 (file)
@@ -1562,6 +1562,11 @@ def fetch_fedilist(args: argparse.Namespace) -> int:
     logger.debug("reader[]='%s'", type(reader))
     for row in reader:
         logger.debug("row[]='%s'", type(row))
+        if "hostname" not in row:
+            logger.warning("row()=%d has no element 'hostname' - SKIPPED!", len(row))
+            continue
+
+        logger.debug("row[hostname]='%s' - BEFORE!", row["hostname"])
         domain = tidyup.domain(row["hostname"])
         logger.debug("domain='%s' - AFTER!", domain)