From: Roland Häder Date: Sat, 16 Dec 2023 13:19:57 +0000 (+0100) Subject: Continued: X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=e8b8393652316f7d55240e671d85081d50ac4d94;p=fba.git Continued: - don't allow empty peer list in federation.add_peers() --- diff --git a/fba/http/federation.py b/fba/http/federation.py index f39bdc8..355036e 100644 --- a/fba/http/federation.py +++ b/fba/http/federation.py @@ -535,6 +535,8 @@ def add_peers(rows: dict) -> list: if not isinstance(rows, dict): raise ValueError(f"Parameter rows[]='{type(rows)}' is not of type 'dict'") + elif len(rows) == 0: + raise ValueError("Parameter 'rows' is empty") peers = list() for key in ["linked", "allowed", "blocked"]: