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:
authorJohn Hiesey <john@hiesey.com>2021-07-14 00:04:18 +0300
committerGitHub <noreply@github.com>2021-07-14 00:04:18 +0300
commitb035cbe9ea59d3fcfc6467dcf4f2f49da2f7c3d8 (patch)
treeb801bab04e39a5c450fb207860158340974d9873 /lib
parentfb241986d8547b0cd335148d957655e500306000 (diff)
fix: call public FileStream.destroy method so cb is defined (#2135)
Previously, early exits in FileStream._notify would throw since cb was not defined in _destroy
Diffstat (limited to 'lib')
-rw-r--r--lib/file-stream.js4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/file-stream.js b/lib/file-stream.js
index b499754..e7dee68 100644
--- a/lib/file-stream.js
+++ b/lib/file-stream.js
@@ -59,7 +59,7 @@ class FileStream extends stream.Readable {
if (this._notifying) return
this._notifying = true
- if (this._torrent.destroyed) return this._destroy(new Error('Torrent removed'))
+ if (this._torrent.destroyed) return this.destroy(new Error('Torrent removed'))
const p = this._piece
@@ -73,7 +73,7 @@ class FileStream extends stream.Readable {
if (this.destroyed) return
debug('read %s (length %s) (err %s)', p, buffer && buffer.length, err && err.message)
- if (err) return this._destroy(err)
+ if (err) return this.destroy(err)
if (this._offset) {
buffer = buffer.slice(this._offset)