diff options
author | Sam Atkins <atkinssj@serenityos.org> | 2022-01-20 17:18:17 +0000 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2022-01-24 22:36:09 +0100 |
commit | c388a879d73633b6ebe8353fd2a0407b908fe26f (patch) | |
tree | 3a09d39c87751105ace98936c8c210c57eee2fe8 /Userland/Applications/PixelPaint | |
parent | f590cd1850027399ab7f0193ba97fa76b3a9cbab (diff) | |
download | serenity-c388a879d73633b6ebe8353fd2a0407b908fe26f.zip |
AK+Userland: Make AK::decode_base64 return ErrorOr
Diffstat (limited to 'Userland/Applications/PixelPaint')
-rw-r--r-- | Userland/Applications/PixelPaint/Image.cpp | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/Userland/Applications/PixelPaint/Image.cpp b/Userland/Applications/PixelPaint/Image.cpp index c16f337d95..b61152a4ae 100644 --- a/Userland/Applications/PixelPaint/Image.cpp +++ b/Userland/Applications/PixelPaint/Image.cpp @@ -88,11 +88,8 @@ ErrorOr<NonnullRefPtr<Image>> Image::try_create_from_pixel_paint_json(JsonObject auto name = layer_object.get("name").as_string(); auto bitmap_base64_encoded = layer_object.get("bitmap").as_string(); - auto bitmap_data = decode_base64(bitmap_base64_encoded); - if (!bitmap_data.has_value()) - return Error::from_string_literal("Base64 decode failed"sv); - - auto bitmap = TRY(try_decode_bitmap(bitmap_data.value())); + auto bitmap_data = TRY(decode_base64(bitmap_base64_encoded)); + auto bitmap = TRY(try_decode_bitmap(bitmap_data)); auto layer = TRY(Layer::try_create_with_bitmap(*image, move(bitmap), name)); auto width = layer_object.get("width").to_i32(); |