mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-09-07 18:17:23 +00:00
AK+Userland: Make AK::decode_base64 return ErrorOr
This commit is contained in:
parent
f590cd1850
commit
c388a879d7
Notes:
sideshowbarker
2024-07-17 23:02:37 +09:00
Author: https://github.com/AtkinsSJ
Commit: c388a879d7
Pull-request: https://github.com/SerenityOS/serenity/pull/12025
11 changed files with 31 additions and 43 deletions
|
@ -119,10 +119,10 @@ int main(int argc, char** argv)
|
|||
}
|
||||
auto base64_data = line.substring(8);
|
||||
auto buffer = decode_base64(base64_data);
|
||||
if (buffer.has_value()) {
|
||||
socket->send(buffer.value(), false);
|
||||
if (buffer.is_error()) {
|
||||
outln("Could not send message : {}", buffer.error().string_literal());
|
||||
} else {
|
||||
outln("Could not send message : Base64 string contains an invalid character.");
|
||||
socket->send(buffer.value(), false);
|
||||
}
|
||||
continue;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue