# HG changeset patch # User Pawel Solyga # Date 1237559872 0 # Node ID 7c97323fd20b678867289730b9aefd330d09ada2 # Parent 921069bcc6e1d3892d61739d7c4015cffdf1588b Slot allocator Javascript fix. This prevents from calling updateFromJSON function if there is no data. Patch by: Mario Ferraro Reviewed by: Pawel Solyga diff -r 921069bcc6e1 -r 7c97323fd20b 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); + } + } ); }