From 0e5cfccc71328e58307ed9fcc929ebdc67a5a92d Mon Sep 17 00:00:00 2001 From: Tobias Christiansen Date: Wed, 19 Oct 2022 12:45:30 +0200 Subject: [PATCH] WebContent: Fix broken Optional<> returns through IPC Apparently one can not use the brace-initializer to return an empty Optional through IPC, it has to be explicitly constructed. --- Userland/Services/WebContent/ConnectionFromClient.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Userland/Services/WebContent/ConnectionFromClient.cpp b/Userland/Services/WebContent/ConnectionFromClient.cpp index 9f34b8144d..b935b4c62a 100644 --- a/Userland/Services/WebContent/ConnectionFromClient.cpp +++ b/Userland/Services/WebContent/ConnectionFromClient.cpp @@ -444,7 +444,7 @@ Messages::WebContentServer::GetDocumentElementResponse ConnectionFromClient::get { auto* document = page().top_level_browsing_context().active_document(); if (!document) - return { {} }; + return Optional {}; return { document->id() }; } @@ -452,16 +452,16 @@ Messages::WebContentServer::QuerySelectorAllResponse ConnectionFromClient::query { auto* start_node = Web::DOM::Node::from_id(start_node_id); if (!start_node) - return { {} }; + return Optional> {}; if (!start_node->is_element() && !start_node->is_document()) - return { {} }; + return Optional> {}; auto& start_element = verify_cast(*start_node); auto result = start_element.query_selector_all(selector); if (result.is_error()) - return { {} }; + return Optional> {}; auto element_list = result.release_value(); Vector return_list;