From d2b5c4d8dc4e15cb70bbfdbc46c7141cef6c94c1 Mon Sep 17 00:00:00 2001 From: AnotherTest Date: Wed, 14 Apr 2021 01:39:29 +0430 Subject: [PATCH] LibWeb: Actually return an empty value when an exception is thrown via throw_dom_exception_if_needed() Fixes #6298. --- Userland/Libraries/LibWeb/Bindings/ExceptionOrUtils.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Userland/Libraries/LibWeb/Bindings/ExceptionOrUtils.h b/Userland/Libraries/LibWeb/Bindings/ExceptionOrUtils.h index 081c04f21ef..a66d4767b8a 100644 --- a/Userland/Libraries/LibWeb/Bindings/ExceptionOrUtils.h +++ b/Userland/Libraries/LibWeb/Bindings/ExceptionOrUtils.h @@ -104,8 +104,8 @@ template bool should_return_empty(const Optional& value) { if constexpr (IsSame) - return value.has_value() && value.value().is_empty(); - return false; + return !value.has_value() || value.value().is_empty(); + return !value.has_value(); } }