1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-26 20:47:45 +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) bool should_return_empty(const Optional<T>& value)
{ {
if constexpr (IsSame<JS::Value, T>) if constexpr (IsSame<JS::Value, T>)
return value.has_value() && value.value().is_empty(); return !value.has_value() || value.value().is_empty();
return false; return !value.has_value();
} }
} }