git ssb

0+

Piet / ssb-loomio



Commit 9e5a426e0a4859825b9743e57b563a7845310484

Improve comparison syntax.

Piet Geursen committed on 4/11/2018, 2:44:12 AM
Parent: 6360e70f9c420261c04295d55bd6181e31a333fb

Files changed

position/async/buildChooseOne.jschanged
position/async/buildChooseOne.jsView
@@ -7,9 +7,9 @@
77 const Position = buildPosition(server)
88
99 return function ChooseOne ({ poll, choice, reason, mentions }, cb) {
1010 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'}))
1212
1313 const opts = {
1414 poll,
1515 details: {

Built with git-ssb-web