diff options
author | Diego RodrÃguez Baquero <diegorbaquero@gmail.com> | 2017-09-10 00:41:54 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-09-10 00:41:54 +0300 |
commit | 1f8000452c3cb9fa1dcc9e580f4a81ad8b6e029d (patch) | |
tree | df2b5180ac26199f4adac2aa9a22658faf0c5755 | |
parent | d8c5855a597d470198f48462c9862c722734cf85 (diff) | |
parent | c04a4167250bfa236f78e91352867aa3c6c9c33f (diff) |
Merge pull request #1166 from aveday/master
Raise error when streaming from a removed torrent
-rw-r--r-- | lib/file-stream.js | 2 |
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 |