changeset 749:7168a9873dde

server_side (blog): fixes avatar callback
author souliane <souliane@mailoo.org>
date Mon, 23 Nov 2015 22:02:18 +0100
parents 0d5889b9313c
children 8ac862f6e5b3
files src/server/blog.py
diffstat 1 files changed, 5 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/src/server/blog.py	Mon Nov 23 16:39:11 2015 +0100
+++ b/src/server/blog.py	Mon Nov 23 22:02:18 2015 +0100
@@ -94,8 +94,11 @@
 
         url = os.path.join(C.AVATARS_DIR, value)
         self.avatars_cache[entity_s] = url
-        self.waiting_deferreds[entity_s].callback(url)
-        del self.waiting_deferreds[entity_s]
+        try:
+            self.waiting_deferreds[entity_s].callback(url)
+            del self.waiting_deferreds[entity_s]
+        except KeyError:
+            pass
 
     def getAvatarURL(self, pub_jid):
         """Return avatar of a jid if in cache, else ask for it.