From e03f802e41007c31bc237fcbbc3c6b72d590938d Mon Sep 17 00:00:00 2001 From: mathieui Date: Tue, 20 Apr 2021 18:55:56 +0200 Subject: fix: do not traceback on invalid jids in config.get_by_servname --- poezio/config.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/poezio/config.py b/poezio/config.py index 3289a8d8..d520ecb8 100644 --- a/poezio/config.py +++ b/poezio/config.py @@ -20,7 +20,7 @@ from pathlib import Path from typing import Dict, List, Optional, Union, Tuple, cast, Any from poezio import xdg -from slixmpp import JID +from slixmpp import JID, InvalidJID log = logging.getLogger(__name__) # type: logging.Logger @@ -278,7 +278,10 @@ class Config: """ Try to get the value of an option for a server """ - server = JID(jid).server + try: + server = JID(jid).server + except InvalidJID: + server = '' if server: server = '@' + server if server in self.sections() and option in self.options(server): -- cgit v1.2.3