Skip to content

Commit

Permalink
fix(node/async_hooks): don't pop async context frame if stack if empty (
Browse files Browse the repository at this point in the history
  • Loading branch information
bartlomieju authored Aug 10, 2023
1 parent 04a259e commit 2507d6f
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions ext/node/polyfills/async_hooks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,9 @@ function pushAsyncFrame(frame: AsyncContextFrame) {
}

function popAsyncFrame() {
assert(asyncContextStack.length > 0);
asyncContextStack.pop();
if (asyncContextStack.length > 0) {
asyncContextStack.pop();
}
}

let rootAsyncFrame: AsyncContextFrame | undefined = undefined;
Expand Down

0 comments on commit 2507d6f

Please sign in to comment.