Skip to content

Commit de19214

Browse files
authored
Avoid passing a nullable value to Completer<nn-type>.complete (dart-lang#1015)
This is cleanup work required to start enforcing this with static analysis, as per dart-lang/sdk#53253. Real quick this issue is that this code is unsafe: ```dart void f(Completer<int> c, int? i) { Future<int>.value(i); // Ouch! c.complete(i); // Ouch! } ```
1 parent 7fb6fd6 commit de19214

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

pkgs/cupertino_http/lib/src/cupertino_api.dart

+1-1
Original file line numberDiff line numberDiff line change
@@ -885,7 +885,7 @@ class URLSessionWebSocketTask extends URLSessionTask {
885885
if (error != null) {
886886
completer.completeError(error);
887887
} else {
888-
completer.complete(message);
888+
completer.complete(message!);
889889
}
890890
completionPort.close();
891891
});

0 commit comments

Comments
 (0)