1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 10:47:35 +00:00

LibCore: Use ErrorOr<T> in Core::AnonymousBuffer

This commit is contained in:
Andreas Kling 2021-11-06 01:20:51 +01:00
parent c4edb9f6c2
commit e2eabb4132
15 changed files with 56 additions and 53 deletions

View file

@ -133,7 +133,9 @@ void SpiceAgent::on_message_received()
m_just_set_clip = true;
if (type == ClipboardType::Text) {
auto anon_buffer = Core::AnonymousBuffer::create_with_size(data_buffer.size());
auto anon_buffer_or_error = Core::AnonymousBuffer::create_with_size(data_buffer.size());
VERIFY(!anon_buffer_or_error.is_error());
auto anon_buffer = anon_buffer_or_error.release_value();
memcpy(anon_buffer.data<void>(), data_buffer.data(), data_buffer.size());
m_clipboard_connection.async_set_clipboard_data(anon_buffer, "text/plain", {});
return;