From fb637a597b5ba396a6e82d0060c9fdde4d9e971c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Maxime=20=E2=80=9Cpep=E2=80=9D=20Buquet?= Date: Sun, 13 Oct 2019 13:32:11 +0200 Subject: omemo: prevent traceback when no JID is specified in non-supported tab MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Maxime “pep” Buquet --- poezio/plugin_e2ee.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/poezio/plugin_e2ee.py b/poezio/plugin_e2ee.py index da6aec9a..9c8fd224 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) -- cgit v1.2.3