From dd623c5da98dbb73a9e583acfeac424352738da6 Mon Sep 17 00:00:00 2001 From: Feross Aboukhadijeh Date: Tue, 26 Jul 2016 20:27:03 -0700 Subject: Skip blocklist logic when opts.blocklist is not set Fixes #862 --- index.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'index.js') diff --git a/index.js b/index.js index 8ed828a..70a2818 100644 --- a/index.js +++ b/index.js @@ -134,7 +134,7 @@ function WebTorrent (opts) { debug('new webtorrent (peerId %s, nodeId %s)', self.peerId, self.nodeId) - if (typeof loadIPSet === 'function') { + if (typeof loadIPSet === 'function' && opts.blocklist != null) { loadIPSet(opts.blocklist, { headers: { 'user-agent': 'WebTorrent/' + VERSION + ' (https://webtorrent.io)' @@ -144,7 +144,9 @@ function WebTorrent (opts) { self.blocked = ipSet ready() }) - } else process.nextTick(ready) + } else { + process.nextTick(ready) + } function ready () { if (self.destroyed) return -- cgit v1.2.3