From f9f98960a056ab69278b94aeca64ccd13b9bff7a Mon Sep 17 00:00:00 2001 From: Andrew Chin Date: Fri, 22 Apr 2011 23:24:57 -0400 Subject: [PATCH] Don't let a missing markers.js or region.js foul up everything Fixes #330 --- web_assets/functions.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/web_assets/functions.js b/web_assets/functions.js index 9fd7d0b..847fba9 100644 --- a/web_assets/functions.js +++ b/web_assets/functions.js @@ -211,6 +211,7 @@ function drawMapControls() { // parse the data as definned in the regions.js function initRegions() { if (regionsInit) { return; } + if (typeof(regionData) == "undefined") { return; } // skip this if we have no region.js file regionsInit = true; for (i in regionGroups) { @@ -295,6 +296,7 @@ function initRegions() { // may need to be reviewed by agrif or someone else... little finicky right now. function initMarkers() { if (markersInit) { return; } // oh, we've already done this? nevermind, exit the function. + if (typeof(markerData) == "undefined") { return; } // no markers.js file, so skip this. markersInit = true; // now that we've started, dont have to do it twice. // first, give all collections an empty array to work with