Slot allocator Javascript fix. This prevents from calling updateFromJSON function if there is no data.
Patch by: Mario Ferraro
Reviewed by: Pawel Solyga
--- 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);
+ }
+ }
);
}