diff wokkel/rsm.py @ 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 c782fb5237f8
children
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)