mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-23 16:10:20 +00:00
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.
This commit is contained in:
parent
d9b543da68
commit
0e5cfccc71
Notes:
sideshowbarker
2024-07-17 05:21:49 +09:00
Author: https://github.com/TobyAsE Commit: https://github.com/SerenityOS/serenity/commit/0e5cfccc71 Pull-request: https://github.com/SerenityOS/serenity/pull/15694 Reviewed-by: https://github.com/linusg ✅
1 changed files with 4 additions and 4 deletions
|
@ -444,7 +444,7 @@ Messages::WebContentServer::GetDocumentElementResponse ConnectionFromClient::get
|
|||
{
|
||||
auto* document = page().top_level_browsing_context().active_document();
|
||||
if (!document)
|
||||
return { {} };
|
||||
return Optional<i32> {};
|
||||
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<Vector<i32>> {};
|
||||
|
||||
if (!start_node->is_element() && !start_node->is_document())
|
||||
return { {} };
|
||||
return Optional<Vector<i32>> {};
|
||||
|
||||
auto& start_element = verify_cast<Web::DOM::ParentNode>(*start_node);
|
||||
|
||||
auto result = start_element.query_selector_all(selector);
|
||||
if (result.is_error())
|
||||
return { {} };
|
||||
return Optional<Vector<i32>> {};
|
||||
|
||||
auto element_list = result.release_value();
|
||||
Vector<i32> return_list;
|
||||
|
|
Loading…
Reference in a new issue