From: Tom Hughes Date: Tue, 5 Feb 2013 17:32:44 +0000 (+0000) Subject: Avoid javascript warning X-Git-Tag: live~5125^2~27 X-Git-Url: https://git.openstreetmap.org/rails.git/commitdiff_plain/d92ca41cae337d705625ea94dae9efb7de2f59e6 Avoid javascript warning --- diff --git a/app/assets/javascripts/index/notes.js.erb b/app/assets/javascripts/index/notes.js.erb index 47a2dc200..3d6cd0a5f 100644 --- a/app/assets/javascripts/index/notes.js.erb +++ b/app/assets/javascripts/index/notes.js.erb @@ -41,7 +41,7 @@ $(document).ready(function () { }); map.on("popupclose", function (e) { - if (e.popup == newNote._popup) { + if (newNote && e.popup == newNote._popup) { $(newNote).oneTime(10, "removenote", function () { map.removeLayer(newNote); });