Skip to content

Commit

Permalink
Fix boolean logic for popping handlers.
Browse files Browse the repository at this point in the history
  • Loading branch information
nathanhammond committed Jun 29, 2016
1 parent de17cef commit b7a34b5
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions lib/route-recognizer/segment-trie-node.js
Original file line number Diff line number Diff line change
Expand Up @@ -348,10 +348,6 @@ SegmentTrieNode.prototype = {
if (!!nextNode) { break; }
}

// Once we get past this loop we should consider the node as "leaf."
// All of the child branches have been pruned.
isLeafNode = true;

// If we're at a terminal node find out if we've consumed the entire path.
if (isTerminalNode) {
if (regexPieces) {
Expand Down Expand Up @@ -379,7 +375,7 @@ SegmentTrieNode.prototype = {
}

// `consumed` is false unless set above.
if (isLeafNode && !consumed) {
if (!consumed && (isLeafNode || !nextNode)) {
if (this.handler) { handlers.pop(); }
return false;
} else {
Expand Down

0 comments on commit b7a34b5

Please sign in to comment.