changeset 410:ef9a4453959b

plugin XEP-0163: user event mood with no item fix
author Goffi <goffi@goffi.org>
date Sat, 08 Oct 2011 20:27:15 +0200
parents 2e0dc5299bce
children b109a79ac72f
files src/plugins/plugin_xep_0163.py
diffstat 1 files changed, 3 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/src/plugins/plugin_xep_0163.py	Sat Oct 08 20:26:36 2011 +0200
+++ b/src/plugins/plugin_xep_0163.py	Sat Oct 08 20:27:15 2011 +0200
@@ -101,6 +101,9 @@
         return self.pep_out_cb[event_type](data, profile)
 
     def userMoodCB(self, itemsEvent, profile):
+        if not itemsEvent.items:
+            debug(_("No item found"))
+            return
         try:
             mood_elem = filter(lambda x:x.name == "mood", itemsEvent.items[0].children)[0]
         except KeyError: