提交 e5442c96 编写于 作者: J Jason Simmons 提交者: GitHub

Return an error to Dart when spawning an isolate with an unsupported URI (#3443)

Fixes https://github.com/flutter/flutter/issues/8084
上级 257817bc
......@@ -261,8 +261,11 @@ Dart_Isolate IsolateCreateCallback(const char* script_uri,
std::vector<uint8_t> snapshot_data;
std::string entry_path;
if (!IsRunningPrecompiledCode()) {
// Assert that entry script URI starts with file://
FTL_CHECK(entry_uri.find(kFileUriPrefix) == 0u);
// Check that the entry script URI starts with file://
if (entry_uri.find(kFileUriPrefix) != 0u) {
*error = strdup("Isolates must use file:// URIs");
return nullptr;
}
// Entry script path (file:// is stripped).
entry_path = std::string(script_uri + strlen(kFileUriPrefix));
if (!running_from_source) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册