1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 21:17:44 +00:00

LibWeb: Actually return an empty value when an exception is thrown via

throw_dom_exception_if_needed()

Fixes #6298.
This commit is contained in:
AnotherTest 2021-04-14 01:39:29 +04:30 committed by Andreas Kling
parent 9c201767a0
commit d2b5c4d8dc

View file

@ -104,8 +104,8 @@ template<typename T>
bool should_return_empty(const Optional<T>& value)
{
if constexpr (IsSame<JS::Value, T>)
return value.has_value() && value.value().is_empty();
return false;
return !value.has_value() || value.value().is_empty();
return !value.has_value();
}
}