From 2334515247f2db6eca56e8df4522dd11d4046057 Mon Sep 17 00:00:00 2001 From: DonIsaac <22823424+DonIsaac@users.noreply.github.com> Date: Tue, 9 Jul 2024 02:59:08 +0000 Subject: [PATCH] fix(linter): panic in `get_enclosing_function` (#4121) Fixes one of the panics described in #4111 --- crates/oxc_linter/src/ast_util.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crates/oxc_linter/src/ast_util.rs b/crates/oxc_linter/src/ast_util.rs index f237bd5dd8df8..7f2f4c40108d4 100644 --- a/crates/oxc_linter/src/ast_util.rs +++ b/crates/oxc_linter/src/ast_util.rs @@ -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())?; } }