Commit 9e5a426e0a4859825b9743e57b563a7845310484
Improve comparison syntax.
Piet Geursen committed on 4/11/2018, 2:44:12 AMParent: 6360e70f9c420261c04295d55bd6181e31a333fb
Files changed
position/async/buildChooseOne.js | changed |
position/async/buildChooseOne.js | ||
---|---|---|
@@ -7,9 +7,9 @@ | ||
7 | 7 | const Position = buildPosition(server) |
8 | 8 | |
9 | 9 | return function ChooseOne ({ poll, choice, reason, mentions }, cb) { |
10 | 10 | if (!isPoll(poll)) return cb(new Error('ChooseOne position factory requires a valid poll')) |
11 | - if (choice > getContent(poll).details.choices.length - 1) return cb(new Error({type: ERROR_POSITION_TYPE, message: 'choice outside valid choices range'})) | |
11 | + if (choice >= getContent(poll).details.choices.length) return cb(new Error({type: ERROR_POSITION_TYPE, message: 'choice outside valid choices range'})) | |
12 | 12 | |
13 | 13 | const opts = { |
14 | 14 | poll, |
15 | 15 | details: { |
Built with git-ssb-web