Index: lib/runtime/dart/async.js |
diff --git a/lib/runtime/dart/async.js b/lib/runtime/dart/async.js |
index 2f574edf73e978abacdefcb2f6d607bcf77762d1..9f026c7ac2bf1a19be55690da00447e615407b02 100644 |
--- a/lib/runtime/dart/async.js |
+++ b/lib/runtime/dart/async.js |
@@ -4070,6 +4070,8 @@ dart_library.library('dart/async', null, /* Imports */[ |
} |
cancel() { |
let subscription = this[_subscription]; |
+ if (subscription == null) |
+ return null; |
if (this[_state] == _StreamIteratorImpl$()._STATE_MOVING) { |
let hasNext = dart.as(this[_futureOrPrefetch], _Future$(core.bool)); |
this[_clear](); |