diff options
-rw-r--r-- | lib/torrent.js | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/lib/torrent.js b/lib/torrent.js index 661c30c..dd49c1d 100644 --- a/lib/torrent.js +++ b/lib/torrent.js @@ -1498,6 +1498,8 @@ Torrent.prototype._request = function (wire, index, hotswap) { var chunkLength = isWebSeed ? piece.chunkLengthRemaining(reservation) : piece.chunkLength(reservation) wire.request(index, chunkOffset, chunkLength, function onChunk (err, chunk) { + if (self.destroyed) return + // TODO: what is this for? if (!self.ready) return self.once('ready', function () { onChunk(err, chunk) }) |