From 792e432c9c16f5ebda7c6063011f2a42c23215e0 Mon Sep 17 00:00:00 2001 From: divdavem Date: Wed, 15 Apr 2020 21:04:48 +0200 Subject: [PATCH] fixes error when trying to access this._reads in chunkstream.js (#147) --- lib/chunkstream.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/chunkstream.js b/lib/chunkstream.js index 71c8ce0..95b46d4 100644 --- a/lib/chunkstream.js +++ b/lib/chunkstream.js @@ -29,7 +29,7 @@ ChunkStream.prototype.read = function (length, callback) { this._process(); // its paused and there is not enought data then ask for more - if (this._paused && this._reads.length > 0) { + if (this._paused && this._reads && this._reads.length > 0) { this._paused = false; this.emit("drain");