From e18c3fd58dd5a2903453d7cfb2fcd4f9fe0e2565 Mon Sep 17 00:00:00 2001 From: Tom Hughes Date: Tue, 3 Dec 2013 17:51:01 +0000 Subject: [PATCH] Log failures to match a route for the initial path --- app/assets/javascripts/router.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) 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); -- 2.39.5