Slot allocator Javascript fix. This prevents from calling updateFromJSON function if there is no data.
authorPawel Solyga <Pawel.Solyga@gmail.com>
Fri, 20 Mar 2009 14:37:52 +0000
changeset 1952 7c97323fd20b
parent 1951 921069bcc6e1
child 1953 6bd827320b3d
Slot allocator Javascript fix. This prevents from calling updateFromJSON function if there is no data. Patch by: Mario Ferraro Reviewed by: Pawel Solyga
app/soc/content/js/slot-allocator.js
--- a/app/soc/content/js/slot-allocator.js	Fri Mar 20 14:18:07 2009 +0000
+++ b/app/soc/content/js/slot-allocator.js	Fri Mar 20 14:37:52 2009 +0000
@@ -39,8 +39,11 @@
 }
 
 function retrieveJSON() {
-  $.getJSON(RETURN_URL+"?_="+(new Date().getTime()),
-    updateFromJSON
+  $.getJSON(RETURN_URL+"?_="+(new Date().getTime()), function(data) {
+    if (data) {
+      updateFromJSON(data);
+    }
+  }
   );
 }