diff frontends/src/jp/common.py @ 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 f15b428852a0
children 78ffb9ce57a4
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: