diff --git a/src/router.js b/src/router.js index a037f69..1dafebb 100644 --- a/src/router.js +++ b/src/router.js @@ -172,6 +172,7 @@ export const getWorkingPath = (parentRouterId) => { } const stackEntry = stack[parentRouterId]; if (!stackEntry) { + // this should not be reached at all throw 'wth'; } @@ -239,6 +240,10 @@ const process = (stackObj, directCall) => { reducedPath: previousReducedPath } = stackObj; + if (!stack[routerId]) { + return; + } + const currentPath = getWorkingPath(parentRouterId); let route = null; let targetFunction = null; @@ -270,10 +275,6 @@ const process = (stackObj, directCall) => { break; } - if (!stack[routerId]) { - return; - } - if (!anyMatched) { route = null; targetFunction = null;