diff options
author | Feross Aboukhadijeh <feross@feross.org> | 2016-06-11 09:26:15 +0300 |
---|---|---|
committer | Feross Aboukhadijeh <feross@feross.org> | 2016-06-11 09:26:15 +0300 |
commit | 6d54baf3f31dbc9620d7b14306b93dcdc091f707 (patch) | |
tree | e204619adf8f05b2028c5fcccddaed5982b12745 /lib | |
parent | df46aea2d8ebfd04d38e4f03ee8284a9d2963f53 (diff) |
Support torrent with a single 0 byte file
Diffstat (limited to 'lib')
-rw-r--r-- | lib/torrent.js | 4 |
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') |