Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/webtorrent/webtorrent.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/torrent.js2
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) })