diff --git a/Userland/Libraries/LibJS/AST.cpp b/Userland/Libraries/LibJS/AST.cpp index 3e327ac365..29e9a8327b 100644 --- a/Userland/Libraries/LibJS/AST.cpp +++ b/Userland/Libraries/LibJS/AST.cpp @@ -818,7 +818,7 @@ Value ClassExpression::execute(Interpreter& interpreter, GlobalObject& global_ob Object* super_constructor_prototype = nullptr; if (!super_constructor.is_null()) { - auto super_constructor_prototype_value = super_constructor.as_object().get(vm.names.prototype); + auto super_constructor_prototype_value = super_constructor.as_object().get(vm.names.prototype).value_or(js_undefined()); if (interpreter.exception()) return {}; if (!super_constructor_prototype_value.is_object() && !super_constructor_prototype_value.is_null()) {