changeset 34:213122b92b08 0.6.1 0.6.1.1 0.7-dev cagou refacoring_messages

tmp/wokkel (rsm): fixes elements count (items retrieval with RSM max = 0)
author souliane <souliane@mailoo.org>
date Fri, 18 Mar 2016 09:14:00 +0100
parents c0f71fd5ed6b
children 79e36496994a
files wokkel/rsm.py
diffstat 1 files changed, 3 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/wokkel/rsm.py	Fri Mar 11 16:39:39 2016 +0100
+++ b/wokkel/rsm.py	Fri Mar 18 09:14:00 2016 +0100
@@ -388,8 +388,9 @@
         def cb(iq):
             items = []
             pubsub_elt = iq.pubsub
-            for element in pubsub_elt.items.elements(pubsub.NS_PUBSUB, 'item'):
-                items.append(element)
+            if pubsub_elt.items:
+                for element in pubsub_elt.items.elements(pubsub.NS_PUBSUB, 'item'):
+                    items.append(element)
 
             try:
                 rsm_response = RSMResponse.fromElement(pubsub_elt)