mirror of
https://github.com/flutter/flutter
synced 2024-10-13 19:52:53 +00:00
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.
This commit is contained in:
parent
c0c6c60b8f
commit
3932a22cdf
|
@ -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');
|
||||
|
|
Loading…
Reference in a new issue