Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(920)

Unified Diff: sdk/lib/async/stream_impl.dart

Issue 896793002: Avoid crashing when a closed StreamIterator is cancelled (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 5 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | tests/lib/async/stream_iterator_double_cancel_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..ffe7bbb4f56aa668392ff8de726cc9d801500edf 100644
--- a/sdk/lib/async/stream_impl.dart
+++ b/sdk/lib/async/stream_impl.dart
@@ -1036,7 +1036,7 @@ class _StreamIteratorImpl<T> implements StreamIterator<T> {
} else {
_clear();
}
- return subscription.cancel();
+ return (subscription == null) ? null : subscription.cancel();
}
void _onData(T data) {
« no previous file with comments | « no previous file | tests/lib/async/stream_iterator_double_cancel_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698