Unverified Commit 3932a22c authored by Vyacheslav Egorov's avatar Vyacheslav Egorov Committed by GitHub

When running tests with --preview-dart-2 check for compilation errors. (#14724)

If compiler failed to produce Kernel binary then compile(...) returns
null to the caller. If we don't check for null we end up trying to
run file called "null" which causes a very confusing crash of the
flutter_tester.
parent c0c6c60b
......@@ -211,6 +211,11 @@ class _FlutterPlatform extends PlatformPlugin {
packagesPath: PackageMap.globalPackagesPath,
);
if (mainDart == null) {
controller.sink.addError(_getErrorMessage('Compilation failed', testPath, shellPath));
return null;
}
// bundlePath needs to point to a folder with `platform.dill` file.
final Directory tempBundleDirectory = fs.systemTempDirectory
.createTempSync('flutter_bundle_directory');
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment