diff options
author | Maxime “pep” Buquet <pep@bouah.net> | 2019-10-13 13:32:11 +0200 |
---|---|---|
committer | Maxime “pep” Buquet <pep@bouah.net> | 2019-12-27 18:58:48 +0100 |
commit | fb637a597b5ba396a6e82d0060c9fdde4d9e971c (patch) | |
tree | e5386c185c68f50b592f4a1be007309ad20b7363 | |
parent | c610a76fd9eed3ff86762c44275cb089f85f950e (diff) | |
download | poezio-fb637a597b5ba396a6e82d0060c9fdde4d9e971c.tar.gz poezio-fb637a597b5ba396a6e82d0060c9fdde4d9e971c.tar.bz2 poezio-fb637a597b5ba396a6e82d0060c9fdde4d9e971c.tar.xz poezio-fb637a597b5ba396a6e82d0060c9fdde4d9e971c.zip |
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.py | 9 |
1 files changed, 8 insertions, 1 deletions
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) |