]> git.openstreetmap.org Git - rails.git/commitdiff
Don't throw an exception if the hash doesn't contain a map argument
authorTom Hughes <tom@compton.nu>
Sat, 30 Nov 2013 13:20:31 +0000 (13:20 +0000)
committerTom Hughes <tom@compton.nu>
Sat, 30 Nov 2013 13:20:31 +0000 (13:20 +0000)
app/assets/javascripts/osm.js.erb

index 392bf5e0c65254de7c3009d8d2c008807ef288c7..c41f040f33f7122339155577cab44495d0070705 100644 (file)
@@ -115,6 +115,10 @@ OSM = {
 
     hash = querystring.parse(hash);
 
 
     hash = querystring.parse(hash);
 
+    if (!(map in hash)) {
+      return false;
+    }
+
     var args = hash.map.split("/");
     if (args.length !== 3) {
       return false;
     var args = hash.map.split("/");
     if (args.length !== 3) {
       return false;