diff options
-rw-r--r-- | web/cobrands/fixmystreet/fixmystreet.js | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/web/cobrands/fixmystreet/fixmystreet.js b/web/cobrands/fixmystreet/fixmystreet.js index a5267d4f2..b663d37ba 100644 --- a/web/cobrands/fixmystreet/fixmystreet.js +++ b/web/cobrands/fixmystreet/fixmystreet.js @@ -391,7 +391,9 @@ $.extend(fixmystreet.set_up, { // /report/new), fetch it first. That will then automatically call this // function again, due to it calling change() on the category if set. if (!fixmystreet.reporting_data) { - fixmystreet.update_pin(fixmystreet.map.getCenter(), false); + if (fixmystreet.map) { + fixmystreet.update_pin(fixmystreet.map.getCenter(), false); + } return; } @@ -399,6 +401,11 @@ $.extend(fixmystreet.set_up, { data = fixmystreet.reporting_data.by_category[category], $category_meta = $('#category_meta'); + if (!data) { + // The Pick a category option, or something gone wrong + return; + } + fixmystreet.bodies = data.bodies || []; if (fixmystreet.body_overrides) { fixmystreet.body_overrides.clear(); |