diff --git a/Userland/Libraries/LibJS/Runtime/RegExpPrototype.cpp b/Userland/Libraries/LibJS/Runtime/RegExpPrototype.cpp index 4b091e585e..c5bf50f21b 100644 --- a/Userland/Libraries/LibJS/Runtime/RegExpPrototype.cpp +++ b/Userland/Libraries/LibJS/Runtime/RegExpPrototype.cpp @@ -257,7 +257,7 @@ ThrowCompletionOr regexp_exec(GlobalObject& global_object, Object& regexp auto result = TRY(vm.call(exec.as_function(), ®exp_object, js_string(vm, move(string)))); if (!result.is_object() && !result.is_null()) - vm.throw_exception(global_object, ErrorType::NotAnObjectOrNull, result.to_string_without_side_effects()); + return vm.throw_completion(global_object, ErrorType::NotAnObjectOrNull, result.to_string_without_side_effects()); return result; }