diff options
author | AnotherTest <ali.mpfard@gmail.com> | 2021-04-14 01:39:29 +0430 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2021-04-13 23:56:19 +0200 |
commit | d2b5c4d8dc4e15cb70bbfdbc46c7141cef6c94c1 (patch) | |
tree | 4b4f4af0cfe0a20270540a0479512370ae48f649 /Userland/Libraries/LibWeb/Bindings/ExceptionOrUtils.h | |
parent | 9c201767a011979ba84b614eca4d5301f867c42f (diff) | |
download | serenity-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.h | 4 |
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(); } } |