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:28:14 +0300
committerFeross Aboukhadijeh <feross@feross.org>2016-06-11 09:28:14 +0300
commita44e9be54339e68357562a0b9bb6a92e33ec0c34 (patch)
treed17eb40fa52770e8a4210675e88f4d2a10f8d928 /lib
parent6d54baf3f31dbc9620d7b14306b93dcdc091f707 (diff)
Use < since it handles NaN in a predictable way, i.e. false
Diffstat (limited to 'lib')
-rw-r--r--lib/torrent.js2
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