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,8 +285,12 @@ class _Compiler { ...@@ -285,8 +285,12 @@ class _Compiler {
} }
Future<dynamic> shutdown() async { Future<dynamic> shutdown() async {
await compiler.shutdown(); // Check for null in case this instance is shut down before the
compiler = null; // lazily-created compiler has been created.
if (compiler != null) {
await compiler.shutdown();
compiler = null;
}
} }
static Future<T> handleTimeout<T>(Future<T> value, String path) { static Future<T> handleTimeout<T>(Future<T> value, String path) {
......
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