Skip to content

Commit

Permalink
fix(linter): panic in get_enclosing_function (#4121)
Browse files Browse the repository at this point in the history
Fixes one of the panics described in #4111
  • Loading branch information
DonIsaac committed Jul 9, 2024
1 parent 3a0f2aa commit 2334515
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion crates/oxc_linter/src/ast_util.rs
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@ pub fn get_enclosing_function<'a, 'b>(
{
return Some(current_node);
}
current_node = ctx.nodes().parent_node(current_node.id()).unwrap();
current_node = ctx.nodes().parent_node(current_node.id())?;
}
}

Expand Down

0 comments on commit 2334515

Please sign in to comment.