Index: utils/pub/error_group.dart |
diff --git a/utils/pub/error_group.dart b/utils/pub/error_group.dart |
index b5f8f8e9ea5fc1f9804b36411473a215e6238fae..d268d61f626540a5ed0a298bba3d6b2e377264f0 100644 |
--- a/utils/pub/error_group.dart |
+++ b/utils/pub/error_group.dart |
@@ -225,6 +225,10 @@ class _ErrorGroupStream extends Stream { |
/// The underlying [StreamController] for [this]. |
final StreamController _controller; |
+ /// The controller's [Stream]. May be different than `_controller.stream` if |
+ /// the wrapped stream is a broadcasting stream. |
+ Stream _stream; |
+ |
/// The [StreamSubscription] that connects the wrapped [Stream] to |
/// [_controller]. |
StreamSubscription _subscription; |
@@ -235,9 +239,10 @@ class _ErrorGroupStream extends Stream { |
/// Creates a new [_ErrorGroupFuture] that's a child of [_group] and wraps |
/// [inner]. |
_ErrorGroupStream(this._group, Stream inner) |
- : _controller = inner.isBroadcast ? |
- new StreamController.broadcast() : |
- new StreamController() { |
+ : _controller = new StreamController() { |
+ this.stream = isBroadcast |
+ ? _controller.stream.asBroadcastStream() |
+ : _controller.stream; |
_subscription = inner.listen((v) { |
_controller.add(v); |
}, onError: (e) { |