[fix] Check for self.chunks before operating on it #29

Merged
merged 1 commit into from Jun 11, 2012
Jump to file
+5 −3
Split
View
@@ -75,9 +75,11 @@ BufferedStream.prototype.pipe = function () {
}
process.nextTick(function () {
- self.chunks.forEach(function (c) { self.emit('data', c) });
- self.size = 0;
- delete self.chunks;
+ if (self.chunks) {
+ self.chunks.forEach(function (c) { self.emit('data', c) });
+ self.size = 0;
+ delete self.chunks;
+ }
if (!self.readable) {
if (self.ended) {