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>2016-06-11 09:26:15 +0300
committerFeross Aboukhadijeh <feross@feross.org>2016-06-11 09:26:15 +0300
commit6d54baf3f31dbc9620d7b14306b93dcdc091f707 (patch)
treee204619adf8f05b2028c5fcccddaed5982b12745 /lib
parentdf46aea2d8ebfd04d38e4f03ee8284a9d2963f53 (diff)
Support torrent with a single 0 byte file
Diffstat (limited to 'lib')
-rw-r--r--lib/torrent.js4
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/torrent.js b/lib/torrent.js
index fd12068..af4c80f 100644
--- a/lib/torrent.js
+++ b/lib/torrent.js
@@ -611,7 +611,9 @@ Torrent.prototype._onStore = function () {
self._debug('on store')
// start off selecting the entire torrent with low priority
- self.select(0, self.pieces.length - 1, false)
+ if (self.pieces.length !== 0) {
+ self.select(0, self.pieces.length - 1, false)
+ }
self.ready = true
self.emit('ready')