summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormathieui <mathieui@mathieui.net>2021-04-20 18:55:56 +0200
committermathieui <mathieui@mathieui.net>2021-04-20 18:55:56 +0200
commite03f802e41007c31bc237fcbbc3c6b72d590938d (patch)
tree1cd91f46aec5e3915a869ddc7c42ab514cd19b23
parente3f9af4a35ad48280dee9ebe064914f4650868f9 (diff)
downloadpoezio-e03f802e41007c31bc237fcbbc3c6b72d590938d.tar.gz
poezio-e03f802e41007c31bc237fcbbc3c6b72d590938d.tar.bz2
poezio-e03f802e41007c31bc237fcbbc3c6b72d590938d.tar.xz
poezio-e03f802e41007c31bc237fcbbc3c6b72d590938d.zip
fix: do not traceback on invalid jids in config.get_by_servname
-rw-r--r--poezio/config.py7
1 files 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):