From b4312f210afb6d780e9117370b29f2135e026244 Mon Sep 17 00:00:00 2001 From: Goffi Date: Fri, 14 Jul 2017 09:06:03 +0200 Subject: [PATCH] jp (common): fixed decode error when item is not specified --- frontends/src/jp/common.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/frontends/src/jp/common.py b/frontends/src/jp/common.py index ff9fe74a..b6fbc875 100644 --- a/frontends/src/jp/common.py +++ b/frontends/src/jp/common.py @@ -425,7 +425,9 @@ class BaseEdit(object): 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: