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
Notes: sideshowbarker 2024-07-18 20:24:25 +09:00

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();
}
}