Add missing returns in system channels handlers (flutter/engine#21523)
The Windows and GLFW embeddings both had cases of missing returns after calling `Error` on a method channel result object, leading to incorrect double-calls on the result if the error paths were ever hit.
This commit is contained in:
@@ -139,6 +139,7 @@ void TextInputPlugin::HandleMethodCall(
|
||||
if (client_config.IsNull()) {
|
||||
result->Error(kBadArgumentError,
|
||||
"Could not set client, missing arguments.");
|
||||
return;
|
||||
}
|
||||
client_id_ = client_id_json.GetInt();
|
||||
input_action_ = "";
|
||||
|
||||
@@ -40,6 +40,7 @@ void CursorHandler::HandleMethodCall(
|
||||
if (kind_iter == arguments.end()) {
|
||||
result->Error("Argument error",
|
||||
"Missing argument while trying to activate system cursor");
|
||||
return;
|
||||
}
|
||||
const auto& kind = std::get<std::string>(kind_iter->second);
|
||||
delegate_->UpdateFlutterCursor(kind);
|
||||
|
||||
Reference in New Issue
Block a user