diff options
author | Sam Atkins <atkinssj@serenityos.org> | 2023-02-17 17:45:08 +0000 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2023-02-19 17:15:47 +0100 |
commit | f2a94268850b56d9cde98e6096eb19f3108cd1b4 (patch) | |
tree | 62f0b4875fabdda97bad215d9a99b63089890726 /Userland/Utilities | |
parent | 2f4c4639203dd6ef1462741c5e25d1ee60d0287b (diff) | |
download | serenity-f2a94268850b56d9cde98e6096eb19f3108cd1b4.zip |
LibTextCodec+Everywhere: Return Optional<Decoder&> from `decoder_for()`
Diffstat (limited to 'Userland/Utilities')
-rw-r--r-- | Userland/Utilities/js.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/Userland/Utilities/js.cpp b/Userland/Utilities/js.cpp index fdeb39e5aa..855f3b1d27 100644 --- a/Userland/Utilities/js.cpp +++ b/Userland/Utilities/js.cpp @@ -882,8 +882,8 @@ ErrorOr<int> serenity_main(Main::Arguments arguments) if (Utf8View { file_contents }.validate()) { builder.append(source); } else { - auto* decoder = TextCodec::decoder_for("windows-1252"sv); - VERIFY(decoder); + auto decoder = TextCodec::decoder_for("windows-1252"sv); + VERIFY(decoder.has_value()); auto utf8_source = TextCodec::convert_input_to_utf8_using_given_decoder_unless_there_is_a_byte_order_mark(*decoder, source); builder.append(utf8_source); |