diff options
Diffstat (limited to 'Userland/Libraries/LibWeb/Encoding')
-rw-r--r-- | Userland/Libraries/LibWeb/Encoding/TextDecoder.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/Userland/Libraries/LibWeb/Encoding/TextDecoder.cpp b/Userland/Libraries/LibWeb/Encoding/TextDecoder.cpp index 28575cd9c7..3e0e3b24ef 100644 --- a/Userland/Libraries/LibWeb/Encoding/TextDecoder.cpp +++ b/Userland/Libraries/LibWeb/Encoding/TextDecoder.cpp @@ -17,11 +17,11 @@ DOM::ExceptionOr<String> TextDecoder::decode(JS::Handle<JS::Object> const& input { // FIXME: Implement the streaming stuff. - auto data_buffer = Bindings::IDL::get_buffer_source_copy(*input.cell()); - if (!data_buffer.has_value()) + auto data_buffer_or_error = Bindings::IDL::get_buffer_source_copy(*input.cell()); + if (data_buffer_or_error.is_error()) return DOM::OperationError::create("Failed to copy bytes from ArrayBuffer"); - - return m_decoder.to_utf8({ data_buffer->data(), data_buffer->size() }); + auto& data_buffer = data_buffer_or_error.value(); + return m_decoder.to_utf8({ data_buffer.data(), data_buffer.size() }); } } |