aboutsummaryrefslogtreecommitdiffstats
path: root/web/js/duplicates.js
diff options
context:
space:
mode:
authorMatthew Somerville <matthew@mysociety.org>2019-07-10 17:51:26 +0100
committerMatthew Somerville <matthew@mysociety.org>2019-07-10 17:51:26 +0100
commitede03130b3b1e225cad2061c58f93a9eb85c203d (patch)
tree00f2badfc7e3c93550fa181ff8c07976be6c9959 /web/js/duplicates.js
parenta6e909df059647d8440e2879d1c82df7b4dceaf1 (diff)
parentc30ae857af7f2e2bccf974da34cf2f3868e7b7f2 (diff)
Merge branch 'defensive-js'
Diffstat (limited to 'web/js/duplicates.js')
-rw-r--r--web/js/duplicates.js6
1 files changed, 6 insertions, 0 deletions
diff --git a/web/js/duplicates.js b/web/js/duplicates.js
index 0844cb5f3..3ed7e6079 100644
--- a/web/js/duplicates.js
+++ b/web/js/duplicates.js
@@ -121,6 +121,9 @@
}
function render_duplicate_pins(api_response) {
+ if (!fixmystreet.markers) {
+ return;
+ }
var markers = fixmystreet.maps.markers_list( api_response.pins, true );
fixmystreet.markers.removeFeatures( current_duplicate_markers );
fixmystreet.markers.addFeatures( markers );
@@ -138,6 +141,9 @@
}
function remove_duplicate_pins() {
+ if (!fixmystreet.markers) {
+ return;
+ }
fixmystreet.markers.removeFeatures( current_duplicate_markers );
}