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:
stuartmorgan
2020-09-30 17:34:50 -04:00
committed by GitHub
parent 81b8c4ac67
commit b493fa3af3
2 changed files with 2 additions and 0 deletions

View File

@@ -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_ = "";

View File

@@ -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);