From ea2ea7a40daf04e258355c56add2895d45d206ae Mon Sep 17 00:00:00 2001 From: Sam Rawlins Date: Thu, 14 Dec 2023 13:28:54 -0800 Subject: [PATCH] Avoid completing a non-nullable Completer with a nullable value (#3328) Implicitly passing a nullable value to a Completer of a non-nullable type can lead to surprising null-asserting exceptions. See https://github.com/dart-lang/sdk/issues/53253 for more details. In this PR, we add an explicit null-assertion, which makes this call in-line with the general concepts of null safety. Fixes https://github.com/flutter/flutter/issues/137294 --- dashboard/lib/service/dev_cocoon.dart | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dashboard/lib/service/dev_cocoon.dart b/dashboard/lib/service/dev_cocoon.dart index 2763391ea..3a9ad5a46 100644 --- a/dashboard/lib/service/dev_cocoon.dart +++ b/dashboard/lib/service/dev_cocoon.dart @@ -35,7 +35,7 @@ class _PausedCommitStatus { void complete() { assert(_pausedStatus != null); - _completer.complete(_pausedStatus); + _completer.complete(_pausedStatus!); _pausedStatus = null; } }