mirror of
https://github.com/RGBCube/serenity
synced 2025-07-26 03:37:43 +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
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();
|
auto* document = page().top_level_browsing_context().active_document();
|
||||||
if (!document)
|
if (!document)
|
||||||
return { {} };
|
return Optional<i32> {};
|
||||||
return { document->id() };
|
return { document->id() };
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -452,16 +452,16 @@ Messages::WebContentServer::QuerySelectorAllResponse ConnectionFromClient::query
|
||||||
{
|
{
|
||||||
auto* start_node = Web::DOM::Node::from_id(start_node_id);
|
auto* start_node = Web::DOM::Node::from_id(start_node_id);
|
||||||
if (!start_node)
|
if (!start_node)
|
||||||
return { {} };
|
return Optional<Vector<i32>> {};
|
||||||
|
|
||||||
if (!start_node->is_element() && !start_node->is_document())
|
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& start_element = verify_cast<Web::DOM::ParentNode>(*start_node);
|
||||||
|
|
||||||
auto result = start_element.query_selector_all(selector);
|
auto result = start_element.query_selector_all(selector);
|
||||||
if (result.is_error())
|
if (result.is_error())
|
||||||
return { {} };
|
return Optional<Vector<i32>> {};
|
||||||
|
|
||||||
auto element_list = result.release_value();
|
auto element_list = result.release_value();
|
||||||
Vector<i32> return_list;
|
Vector<i32> return_list;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue