Unverified Commit 7bdd31f7 authored by Greg Spencer's avatar Greg Spencer Committed by GitHub

Fix access of null compiler in flutter tests that fail before creating the compiler. (#20553)

In certain cases, the test would fail before creating the (lazily created) compiler object, and then we'd
try to call shutdown() on null in those cases.

Fixes #18610
parent 33c4cd0f
......@@ -285,9 +285,13 @@ class _Compiler {
}
Future<dynamic> shutdown() async {
// Check for null in case this instance is shut down before the
// lazily-created compiler has been created.
if (compiler != null) {
await compiler.shutdown();
compiler = null;
}
}
static Future<T> handleTimeout<T>(Future<T> value, String path) {
return value.timeout(const Duration(minutes: 5), onTimeout: () {
......
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