diff options
author | Feross Aboukhadijeh <feross@feross.org> | 2016-01-04 03:31:56 +0300 |
---|---|---|
committer | Feross Aboukhadijeh <feross@feross.org> | 2016-01-04 03:31:56 +0300 |
commit | c64d8f2fecabb0b164cccb53b657f14bd894a24d (patch) | |
tree | fe02f806548f3f283f9538e8f9c0b975d4361217 /lib | |
parent | bec1e192636537f7e163f72f49dc335093ab2beb (diff) |
cmd: fix exception when quitting
Diffstat (limited to 'lib')
-rw-r--r-- | lib/file-stream.js | 4 |
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) + } } |