| Index: sdk/lib/io/io_stream_consumer.dart
|
| diff --git a/sdk/lib/io/io_stream_consumer.dart b/sdk/lib/io/io_stream_consumer.dart
|
| index 988eaf6e054c796b9c33b4cc239ab6f89ec0a245..b872fe4cf661eae9867cbf6bc10bc43448ea7e03 100644
|
| --- a/sdk/lib/io/io_stream_consumer.dart
|
| +++ b/sdk/lib/io/io_stream_consumer.dart
|
| @@ -144,7 +144,10 @@ class IOSink<T> implements StreamConsumer<List<int>, T> {
|
| onDone: () {
|
| _bindSubscription = null;
|
| if (unbind) {
|
| - unbindCompleter.complete(null);
|
| + if (unbindCompleter != null) {
|
| + unbindCompleter.complete(null);
|
| + unbindCompleter = null;
|
| + }
|
| } else {
|
| _controller.close();
|
| }
|
| @@ -152,6 +155,11 @@ class IOSink<T> implements StreamConsumer<List<int>, T> {
|
| onError: _controller.signalError);
|
| if (_paused) _pause();
|
| if (unbind) {
|
| + _pipeFuture.catchError((error) {
|
| + if (unbindCompleter != null) {
|
| + unbindCompleter.completeError(error);
|
| + }
|
| + });
|
| return unbindCompleter.future;
|
| } else {
|
| return _pipeFuture;
|
|
|