Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.
Merged
Next Next commit
Null-assert the value given to a Completer expecting a non-null value
The code with out the null assertion is legal as per the type signature, but will throw a runtime exception if the nullable value is null. To make this exception more explicit, the value must be null-checked before completing the completer with the value.

The analyzer will soon enforce such checks. See dart-lang/sdk#53253.

This PR is behaviorally a no-op.

Fixes flutter/flutter#136775
  • Loading branch information
srawlins authored Dec 14, 2023
commit 8c0e4a1f3d5fd525b4baeb61f4bc2b5bfd60be83
2 changes: 1 addition & 1 deletion lib/web_ui/test/engine/clipboard_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ Future<void> testMain() async {
const MethodCodec codec = JSONMethodCodec();
final Completer<ByteData> completer = Completer<ByteData>();
void callback(ByteData? data) {
completer.complete(data);
completer.complete(data!);
}

clipboardMessageHandler.setDataMethodCall(
Expand Down