changeset 2334:ca14e1ced3b5

jp (common): fixed decode error when item is not specified
author Goffi <goffi@goffi.org>
date Fri, 14 Jul 2017 09:06:03 +0200
parents a21b3b31086d
children b226f545f67e
files frontends/src/jp/common.py
diffstat 1 files changed, 3 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/frontends/src/jp/common.py	Fri Jul 14 08:34:10 2017 +0200
+++ b/frontends/src/jp/common.py	Fri Jul 14 09:06:03 2017 +0200
@@ -425,7 +425,9 @@
                 except KeyError:
                     self.disp(u'No node found in xmpp: URI, can\'t retrieve item', error=True)
                     self.host.quit(1)
-                pubsub_item = pubsub_data.get('item',[None])[0].decode('utf-8')
+                pubsub_item = pubsub_data.get('item',[None])[0]
+                if pubsub_item is not None:
+                    pubsub_item = pubsub_item.decode('utf-8')
                 if pubsub_item is None and self.args.last_item:
                     command = 'last'
                 elif pubsub_item is not None: