summaryrefslogtreecommitdiff
path: root/Userland/Libraries/LibWeb/Bindings/ExceptionOrUtils.h
diff options
context:
space:
mode:
authorAnotherTest <ali.mpfard@gmail.com>2021-04-14 01:39:29 +0430
committerAndreas Kling <kling@serenityos.org>2021-04-13 23:56:19 +0200
commitd2b5c4d8dc4e15cb70bbfdbc46c7141cef6c94c1 (patch)
tree4b4f4af0cfe0a20270540a0479512370ae48f649 /Userland/Libraries/LibWeb/Bindings/ExceptionOrUtils.h
parent9c201767a011979ba84b614eca4d5301f867c42f (diff)
downloadserenity-d2b5c4d8dc4e15cb70bbfdbc46c7141cef6c94c1.zip
LibWeb: Actually return an empty value when an exception is thrown via
throw_dom_exception_if_needed() Fixes #6298.
Diffstat (limited to 'Userland/Libraries/LibWeb/Bindings/ExceptionOrUtils.h')
-rw-r--r--Userland/Libraries/LibWeb/Bindings/ExceptionOrUtils.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/Userland/Libraries/LibWeb/Bindings/ExceptionOrUtils.h b/Userland/Libraries/LibWeb/Bindings/ExceptionOrUtils.h
index 081c04f21e..a66d4767b8 100644
--- a/Userland/Libraries/LibWeb/Bindings/ExceptionOrUtils.h
+++ b/Userland/Libraries/LibWeb/Bindings/ExceptionOrUtils.h
@@ -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();
}
}