From e5442c96ae955e0ee8e9accdbc69710c36eb441a Mon Sep 17 00:00:00 2001 From: Jason Simmons Date: Fri, 24 Feb 2017 09:44:36 -0800 Subject: [PATCH] Return an error to Dart when spawning an isolate with an unsupported URI (#3443) Fixes https://github.com/flutter/flutter/issues/8084 --- runtime/dart_init.cc | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/runtime/dart_init.cc b/runtime/dart_init.cc index 0e940db40..e4f314027 100644 --- a/runtime/dart_init.cc +++ b/runtime/dart_init.cc @@ -261,8 +261,11 @@ Dart_Isolate IsolateCreateCallback(const char* script_uri, std::vector 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) { -- GitLab