aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--web/cobrands/fixmystreet-uk-councils/roadworks.js9
1 files changed, 7 insertions, 2 deletions
diff --git a/web/cobrands/fixmystreet-uk-councils/roadworks.js b/web/cobrands/fixmystreet-uk-councils/roadworks.js
index 05417545d..083f669c8 100644
--- a/web/cobrands/fixmystreet-uk-councils/roadworks.js
+++ b/web/cobrands/fixmystreet-uk-councils/roadworks.js
@@ -34,11 +34,16 @@ OpenLayers.Format.RoadworksForwardPlanning = OpenLayers.Class(OpenLayers.Format.
var results = null;
var obj = null;
if (typeof json == "string") {
- obj = OpenLayers.Format.JSON.prototype.read.apply(this, [json, filter]);
+ try {
+ obj = OpenLayers.Format.JSON.prototype.read.apply(this, [json, filter]);
+ } catch (error) {
+ OpenLayers.Console.error("Bad JSON: " + error);
+ return;
+ }
} else {
obj = json;
}
- if(!obj) {
+ if(!obj || !obj.query) {
OpenLayers.Console.error("Bad JSON: " + json);
return;
}