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
path: root/lib
diff options
context:
space:
mode:
authorFeross Aboukhadijeh <feross@feross.org>2016-01-04 03:31:56 +0300
committerFeross Aboukhadijeh <feross@feross.org>2016-01-04 03:31:56 +0300
commitc64d8f2fecabb0b164cccb53b657f14bd894a24d (patch)
treefe02f806548f3f283f9538e8f9c0b975d4361217 /lib
parentbec1e192636537f7e163f72f49dc335093ab2beb (diff)
cmd: fix exception when quitting
Diffstat (limited to 'lib')
-rw-r--r--lib/file-stream.js4
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/file-stream.js b/lib/file-stream.js
index b69c551..83fe066 100644
--- a/lib/file-stream.js
+++ b/lib/file-stream.js
@@ -82,5 +82,7 @@ FileStream.prototype._notify = function () {
FileStream.prototype.destroy = function () {
if (this.destroyed) return
this.destroyed = true
- this._torrent.deselect(this._startPiece, this._endPiece, true)
+ if (!this._torrent.destroyed) {
+ this._torrent.deselect(this._startPiece, this._endPiece, true)
+ }
}