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:
Diffstat (limited to 'lib')
-rw-r--r--lib/torrent.js3
1 files changed, 3 insertions, 0 deletions
diff --git a/lib/torrent.js b/lib/torrent.js
index f2c1432..f56b75c 100644
--- a/lib/torrent.js
+++ b/lib/torrent.js
@@ -508,6 +508,9 @@ class Torrent extends EventEmitter {
// Emit 'metadata' before 'ready' and 'done'
this.emit('metadata')
+ // User might destroy torrent in response to 'metadata' event
+ if (this.destroyed) return
+
if (this.skipVerify) {
// Skip verifying exisitng data and just assume it's correct
this._markAllVerified()