diff --git a/Source/JavaScriptCore/runtime/ErrorInstance.cpp b/Source/JavaScriptCore/runtime/ErrorInstance.cpp index e8d226ea9dc1f..e77be60ea99cf 100644 --- a/Source/JavaScriptCore/runtime/ErrorInstance.cpp +++ b/Source/JavaScriptCore/runtime/ErrorInstance.cpp @@ -281,7 +281,7 @@ String ErrorInstance::sanitizedNameString(JSGlobalObject* globalObject) } RETURN_IF_EXCEPTION(scope, {}); - if (!nameValue || !nameValue.isPrimitive()) + if (!nameValue || !nameValue.isPrimitive() || nameValue.isUndefined()) return "Error"_s; RELEASE_AND_RETURN(scope, nameValue.toWTFString(globalObject)); }