aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMaxime “pep” Buquet2019-10-13 11:32:11 (GMT)
committerMaxime “pep” Buquet2019-12-27 17:58:48 (GMT)
commitfb637a597b5ba396a6e82d0060c9fdde4d9e971c (patch)
treee5386c185c68f50b592f4a1be007309ad20b7363
parentc610a76fd9eed3ff86762c44275cb089f85f950e (diff)
downloadpoezio-fb637a597b5ba396a6e82d0060c9fdde4d9e971c.tar.gz
poezio-fb637a597b5ba396a6e82d0060c9fdde4d9e971c.tar.xz
omemo: prevent traceback when no JID is specified in non-supported tab
Signed-off-by: Maxime “pep” Buquet <pep@bouah.net>
-rw-r--r--poezio/plugin_e2ee.py9
1 files changed, 8 insertions, 1 deletions
diff --git a/poezio/plugin_e2ee.py b/poezio/plugin_e2ee.py
index da6aec9..9c8fd22 100644
--- a/poezio/plugin_e2ee.py
+++ b/poezio/plugin_e2ee.py
@@ -269,8 +269,15 @@ class E2EEPlugin(BasePlugin):
def _command_show_fingerprints(self, args: List[str]) -> None:
if not args and isinstance(self.api.current_tab(), self.supported_tab_types):
jid = self.api.current_tab().jid
- else:
+ elif args:
jid = args[0]
+ else:
+ self.api.information(
+ '%s_fingerprint: Couldn\'t deduce JID from context' % (
+ self.encryption_short_name),
+ 'Error',
+ )
+ return None
self._show_fingerprints(JID(jid))
@command_args_parser.quoted(2)