diff options
author | Feross Aboukhadijeh <feross@feross.org> | 2016-06-11 09:28:14 +0300 |
---|---|---|
committer | Feross Aboukhadijeh <feross@feross.org> | 2016-06-11 09:28:14 +0300 |
commit | a44e9be54339e68357562a0b9bb6a92e33ec0c34 (patch) | |
tree | d17eb40fa52770e8a4210675e88f4d2a10f8d928 /lib | |
parent | 6d54baf3f31dbc9620d7b14306b93dcdc091f707 (diff) |
Use < since it handles NaN in a predictable way, i.e. false
Diffstat (limited to 'lib')
-rw-r--r-- | lib/torrent.js | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/torrent.js b/lib/torrent.js index af4c80f..6d29c5e 100644 --- a/lib/torrent.js +++ b/lib/torrent.js @@ -849,7 +849,7 @@ Torrent.prototype.select = function (start, end, priority, notify) { var self = this if (self.destroyed) throw new Error('torrent is destroyed') - if (start > end || start < 0 || end >= self.pieces.length) { + if (start < 0 || end < start || self.pieces.length <= end) { throw new Error('invalid selection ', start, ':', end) } priority = Number(priority) || 0 |