From b7835ba713d0b484e90020f747e19093a132829d Mon Sep 17 00:00:00 2001 From: =?utf8?q?Roland=20H=C3=A4der?= Date: Thu, 13 Jul 2023 12:46:52 +0200 Subject: [PATCH] Continued: - check if dict 'row' has key 'hostname' --- fba/commands.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/fba/commands.py b/fba/commands.py index b96ab65..47d21ed 100644 --- a/fba/commands.py +++ b/fba/commands.py @@ -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) -- 2.39.5