Skip to content

Commit

Permalink
Avoid completing a non-nullable Completer with a nullable value (#3328)
Browse files Browse the repository at this point in the history
Implicitly passing a nullable value to a Completer of a non-nullable type can lead to surprising null-asserting exceptions. See dart-lang/sdk#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 flutter/flutter#137294
  • Loading branch information
srawlins authored Dec 14, 2023
1 parent 2a289b0 commit ea2ea7a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion dashboard/lib/service/dev_cocoon.dart
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ class _PausedCommitStatus {

void complete() {
assert(_pausedStatus != null);
_completer.complete(_pausedStatus);
_completer.complete(_pausedStatus!);
_pausedStatus = null;
}
}
Expand Down

0 comments on commit ea2ea7a

Please sign in to comment.