diff --git a/lib/router.js b/lib/router.js index d56a6ac..78b1c33 100644 --- a/lib/router.js +++ b/lib/router.js @@ -510,7 +510,7 @@ Router.prototype.register = function (path, methods, middleware, opts) { var added = false; if (!route.paramNames.length) { - var routeNestingLevel = route.path.split('/').length; + var routeNestingLevel = route.path.toString().split('/').length; added = stack.some(function (m, i) { var mNestingLevel = m.path.split('/').length;