Skip to content
This repository was archived by the owner on Nov 15, 2022. It is now read-only.

Fix the wth Exception #164

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions src/router.js
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,7 @@ export const getWorkingPath = (parentRouterId) => {
}
const stackEntry = stack[parentRouterId];
if (!stackEntry) {
// this should not be reached at all
throw 'wth';
}

Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -270,10 +275,6 @@ const process = (stackObj, directCall) => {
break;
}

if (!stack[routerId]) {
return;
}

if (!anyMatched) {
route = null;
targetFunction = null;
Expand Down