1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 18:17:44 +00:00

AK+Userland: Make AK::decode_base64 return ErrorOr

This commit is contained in:
Sam Atkins 2022-01-20 17:18:17 +00:00 committed by Andreas Kling
parent f590cd1850
commit c388a879d7
11 changed files with 31 additions and 43 deletions

View file

@ -499,7 +499,9 @@ void MailWidget::selected_email_to_load()
if (selected_alternative_encoding.equals_ignoring_case("7bit") || selected_alternative_encoding.equals_ignoring_case("8bit")) {
decoded_data = encoded_data;
} else if (selected_alternative_encoding.equals_ignoring_case("base64")) {
decoded_data = decode_base64(encoded_data).value_or(ByteBuffer());
auto decoded_base64 = decode_base64(encoded_data);
if (!decoded_base64.is_error())
decoded_data = decoded_base64.release_value();
} else if (selected_alternative_encoding.equals_ignoring_case("quoted-printable")) {
decoded_data = IMAP::decode_quoted_printable(encoded_data);
} else {