From: Tom Hughes Date: Tue, 3 Dec 2013 17:51:01 +0000 (+0000) Subject: Log failures to match a route for the initial path X-Git-Tag: live~4570 X-Git-Url: https://git.openstreetmap.org/rails.git/commitdiff_plain/e18c3fd58dd5a2903453d7cfb2fcd4f9fe0e2565 Log failures to match a route for the initial path --- diff --git a/app/assets/javascripts/router.js b/app/assets/javascripts/router.js index cadb6b628..0d57b80d4 100644 --- a/app/assets/javascripts/router.js +++ b/app/assets/javascripts/router.js @@ -169,8 +169,12 @@ OSM.Router = function(map, rts) { }; router.load = function() { - var loadState = currentRoute.run('load', currentPath); - router.stateChange(loadState || {}); + if (currentRoute) { + var loadState = currentRoute.run('load', currentPath); + router.stateChange(loadState || {}); + } else { + console.log("Unable to match route for: " + currentPath); + } }; map.on('moveend baselayerchange overlaylayerchange', router.updateHash);