未验证 提交 08465e80 编写于 作者: C Chris Bracken 提交者: GitHub

Verify RunConfiguration is valid before running (#6922)

In cases where a valid IsolateConfiguration cannot be inferred, (e.g.,
settings.kernel_list_asset is missing) RunConfiguration can be created
with a null IsolateConfiguration. In such cases, bail out early with
kInvalidSettings.

Also adds a redundant paranoid check to EmbedderEngine::Run.
上级 f986a12e
......@@ -384,6 +384,9 @@ FlutterResult FlutterEngineRun(size_t version,
run_configuration.AddAssetResolver(
std::make_unique<blink::DirectoryAssetBundle>(fml::OpenDirectory(
settings.assets_path.c_str(), false, fml::FilePermission::kRead)));
if (!run_configuration.IsValid()) {
return kInvalidArguments;
}
if (!embedder_engine->Run(std::move(run_configuration))) {
return kInvalidArguments;
......
......@@ -47,7 +47,7 @@ bool EmbedderEngine::NotifyDestroyed() {
}
bool EmbedderEngine::Run(RunConfiguration run_configuration) {
if (!IsValid()) {
if (!IsValid() || !run_configuration.IsValid()) {
return false;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册