1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 11:18:11 +00:00

LibJS: Don't die when making PrimitiveString from "" DeprecatedFlyString

This commit is contained in:
Andreas Kling 2023-11-27 13:37:03 +01:00
parent ecfcc9aef3
commit eda2a6d9f7

View file

@ -223,6 +223,8 @@ NonnullGCPtr<PrimitiveString> PrimitiveString::create(VM& vm, DeprecatedString s
NonnullGCPtr<PrimitiveString> PrimitiveString::create(VM& vm, DeprecatedFlyString const& string)
{
if (string.is_empty())
return vm.empty_string();
return create(vm, *string.impl());
}