From 32faf8e3b8d93e98173c3d4cff92fc773fe083b5 Mon Sep 17 00:00:00 2001 From: Alain St-Denis Date: Tue, 22 Nov 2022 13:06:57 +0000 Subject: [PATCH] catch IndexError exception --- federation/utils/network.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/federation/utils/network.py b/federation/utils/network.py index ab84af9..52a630b 100644 --- a/federation/utils/network.py +++ b/federation/utils/network.py @@ -215,7 +215,7 @@ def try_retrieve_webfinger_document(handle: str) -> Optional[str]: """ try: host = handle.split("@")[1] - except AttributeError: + except (AttributeError, IndexError): logger.warning("retrieve_webfinger_document: invalid handle given: %s", handle) return None document, code, exception = fetch_document(