| Index: sdk/lib/async/stream_impl.dart
|
| diff --git a/sdk/lib/async/stream_impl.dart b/sdk/lib/async/stream_impl.dart
|
| index 394e1c6a7c72b51b25fc7df35554941a94e2e2e5..eef9660404d6261e713bc8424eef0a4d01de0958 100644
|
| --- a/sdk/lib/async/stream_impl.dart
|
| +++ b/sdk/lib/async/stream_impl.dart
|
| @@ -1036,7 +1036,10 @@ class _StreamIteratorImpl<T> implements StreamIterator<T> {
|
| } else {
|
| _clear();
|
| }
|
| - return subscription.cancel();
|
| + // If the stream is done, the subscription will have been cleared.
|
| + return subscription == null
|
| + ? new _Future<Null>.immediate(null)
|
| + : subscription.cancel();
|
| }
|
|
|
| void _onData(T data) {
|
|
|