]> git.openstreetmap.org Git - rails.git/commitdiff
Don't try and route to a note with no ID
authorTom Hughes <tom@compton.nu>
Fri, 25 Apr 2014 23:13:49 +0000 (00:13 +0100)
committerTom Hughes <tom@compton.nu>
Fri, 25 Apr 2014 23:13:49 +0000 (00:13 +0100)
Fixes #733

app/assets/javascripts/index/notes.js.erb

index 841ae1f7bdf652096e80399782474513deb1d880..4e45cbe05238b092f88559e930fc9d01f28bb73f 100644 (file)
@@ -34,7 +34,9 @@ function initializeNotes(map) {
   });
 
   noteLayer.on('click', function(e) {
-    OSM.router.route('/note/' + e.layer.id);
+    if (e.layer.id) {
+      OSM.router.route('/note/' + e.layer.id);
+    }
   });
 
   function updateMarker(marker, feature) {