Index: tool/input_sdk/lib/async/stream_impl.dart |
diff --git a/tool/input_sdk/lib/async/stream_impl.dart b/tool/input_sdk/lib/async/stream_impl.dart |
index dbf3f1b6398a278d72cebf6aadefabc32d51675f..b613cfdc8c23093046fbb915903a453e6ea0fa21 100644 |
--- a/tool/input_sdk/lib/async/stream_impl.dart |
+++ b/tool/input_sdk/lib/async/stream_impl.dart |
@@ -1029,6 +1029,8 @@ class _StreamIteratorImpl<T> implements StreamIterator<T> { |
Future cancel() { |
StreamSubscription subscription = _subscription; |
+ // Cherry pick of: https://codereview.chromium.org//896793002 |
+ if (subscription == null) return null; |
if (_state == _STATE_MOVING) { |
_Future<bool> hasNext = _futureOrPrefetch; |
_clear(); |