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>2015-06-11 04:41:38 +0300
committerFeross Aboukhadijeh <feross@feross.org>2015-06-11 04:43:45 +0300
commit38de6fd5893a10acc3c6b52ba3fad984e13854c6 (patch)
tree1046909ca486468296b2b20781daf5ec233f67c0 /lib
parent3c816df86c233b33bb5b6bfcfd6bb14411f36a51 (diff)
return if destroyed
Diffstat (limited to 'lib')
-rw-r--r--lib/torrent.js2
1 files changed, 2 insertions, 0 deletions
diff --git a/lib/torrent.js b/lib/torrent.js
index 941a266..4d7e65f 100644
--- a/lib/torrent.js
+++ b/lib/torrent.js
@@ -146,6 +146,7 @@ Object.defineProperty(Torrent.prototype, 'torrentFileURL', {
Torrent.prototype._onTorrentId = function (torrentId) {
var self = this
+ if (self.destroyed) return
var parsedTorrent = torrentId && torrentId.parsedTorrent
if (parsedTorrent) {
self._onParsedTorrent(parsedTorrent)
@@ -160,6 +161,7 @@ Torrent.prototype._onTorrentId = function (torrentId) {
Torrent.prototype._onParsedTorrent = function (parsedTorrent) {
var self = this
+ if (self.destroyed) return
self.parsedTorrent = parsedTorrent
self.infoHash = parsedTorrent.infoHash