Skip to content
This repository has been archived by the owner on Feb 25, 2020. It is now read-only.

Commit

Permalink
fix corner case when Stream.close() is called multiple times
Browse files Browse the repository at this point in the history
  • Loading branch information
alexlamsl committed May 20, 2014
1 parent 4ac6e9a commit f6e38d7
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/io.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit f6e38d7

Please sign in to comment.