diff --git a/Userland/Libraries/LibJS/Parser.cpp b/Userland/Libraries/LibJS/Parser.cpp index d9ab8aa10f..3f8a809610 100644 --- a/Userland/Libraries/LibJS/Parser.cpp +++ b/Userland/Libraries/LibJS/Parser.cpp @@ -4988,7 +4988,8 @@ template NonnullRefPtr Parser::parse_function_node(u16, Opt NonnullRefPtr Parser::create_identifier_and_register_in_current_scope(SourceRange range, DeprecatedFlyString string) { auto id = create_ast_node(range, string); - m_state.current_scope_pusher->register_identifier(const_cast(*id)); + if (m_state.current_scope_pusher) + m_state.current_scope_pusher->register_identifier(const_cast(*id)); return id; }