]> git.openstreetmap.org Git - rails.git/commitdiff
Avoid javascript warning
authorTom Hughes <tom@compton.nu>
Tue, 5 Feb 2013 17:32:44 +0000 (17:32 +0000)
committerTom Hughes <tom@compton.nu>
Tue, 5 Feb 2013 17:32:44 +0000 (17:32 +0000)
app/assets/javascripts/index/notes.js.erb

index 47a2dc200e153d440b3e9a7babaae7f290b41742..3d6cd0a5f01c52ed38b5d95ce68b9eae330fcfcb 100644 (file)
@@ -41,7 +41,7 @@ $(document).ready(function () {
   });
 
   map.on("popupclose", function (e) {
   });
 
   map.on("popupclose", function (e) {
-    if (e.popup == newNote._popup) {
+    if (newNote && e.popup == newNote._popup) {
       $(newNote).oneTime(10, "removenote", function () {
         map.removeLayer(newNote);
       });
       $(newNote).oneTime(10, "removenote", function () {
         map.removeLayer(newNote);
       });