diff --git a/lib/io.js b/lib/io.js index 9fee258..34d3ac3 100644 --- a/lib/io.js +++ b/lib/io.js @@ -216,7 +216,7 @@ Stream.prototype.close = function() { }); Fiber.yield(); } - if (typeof this.stream.close === 'function') { + if (this.stream && typeof this.stream.close === 'function') { this.stream.close(); } this.ended = true;