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:
authorDiego Rodríguez Baquero <diegorbaquero@gmail.com>2017-09-10 00:41:54 +0300
committerGitHub <noreply@github.com>2017-09-10 00:41:54 +0300
commit1f8000452c3cb9fa1dcc9e580f4a81ad8b6e029d (patch)
treedf2b5180ac26199f4adac2aa9a22658faf0c5755
parentd8c5855a597d470198f48462c9862c722734cf85 (diff)
parentc04a4167250bfa236f78e91352867aa3c6c9c33f (diff)
Merge pull request #1166 from aveday/master
Raise error when streaming from a removed torrent
-rw-r--r--lib/file-stream.js2
1 files changed, 2 insertions, 0 deletions
diff --git a/lib/file-stream.js b/lib/file-stream.js
index 508f358..11514b4 100644
--- a/lib/file-stream.js
+++ b/lib/file-stream.js
@@ -56,6 +56,8 @@ FileStream.prototype._notify = function () {
if (self._notifying) return
self._notifying = true
+ if (self._torrent.destroyed) return self._destroy(new Error('Torrent removed'))
+
var p = self._piece
self._torrent.store.get(p, function (err, buffer) {
self._notifying = false