From e8b8393652316f7d55240e671d85081d50ac4d94 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Roland=20H=C3=A4der?= Date: Sat, 16 Dec 2023 14:19:57 +0100 Subject: [PATCH] Continued: - don't allow empty peer list in federation.add_peers() --- fba/http/federation.py | 2 ++ 1 file changed, 2 insertions(+) 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"]: -- 2.39.5