summaryrefslogtreecommitdiff
path: root/Userland/Libraries/LibWeb/Bindings/WindowObject.cpp
diff options
context:
space:
mode:
authorSam Atkins <atkinssj@serenityos.org>2022-01-20 17:18:17 +0000
committerAndreas Kling <kling@serenityos.org>2022-01-24 22:36:09 +0100
commitc388a879d73633b6ebe8353fd2a0407b908fe26f (patch)
tree3a09d39c87751105ace98936c8c210c57eee2fe8 /Userland/Libraries/LibWeb/Bindings/WindowObject.cpp
parentf590cd1850027399ab7f0193ba97fa76b3a9cbab (diff)
downloadserenity-c388a879d73633b6ebe8353fd2a0407b908fe26f.zip
AK+Userland: Make AK::decode_base64 return ErrorOr
Diffstat (limited to 'Userland/Libraries/LibWeb/Bindings/WindowObject.cpp')
-rw-r--r--Userland/Libraries/LibWeb/Bindings/WindowObject.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/Userland/Libraries/LibWeb/Bindings/WindowObject.cpp b/Userland/Libraries/LibWeb/Bindings/WindowObject.cpp
index 85eaf2632d..88a20ab02a 100644
--- a/Userland/Libraries/LibWeb/Bindings/WindowObject.cpp
+++ b/Userland/Libraries/LibWeb/Bindings/WindowObject.cpp
@@ -340,7 +340,7 @@ JS_DEFINE_NATIVE_FUNCTION(WindowObject::atob)
return vm.throw_completion<JS::TypeError>(global_object, JS::ErrorType::BadArgCountOne, "atob");
auto string = TRY(vm.argument(0).to_string(global_object));
auto decoded = decode_base64(StringView(string));
- if (!decoded.has_value())
+ if (decoded.is_error())
return vm.throw_completion<JS::TypeError>(global_object, JS::ErrorType::InvalidFormat, "Base64");
// decode_base64() returns a byte string. LibJS uses UTF-8 for strings. Use Latin1Decoder to convert bytes 128-255 to UTF-8.