Skip to content

Commit

Permalink
Change bounds check in advance function
Browse files Browse the repository at this point in the history
If you are changing the divisions you can get into a situation where
the current step is out of bounds.
  • Loading branch information
kasbah committed Sep 24, 2016
1 parent a845e19 commit 9e3a555
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@ function loop() {
}

function advance() {
if (this.step >= this.division) this.step = 0;
this.emit('' + this.step, this.sequence[this.step]);
this.step = (this.step + 1);
if (this.step === this.division) this.step = 0;
}

function resume() {
Expand Down

0 comments on commit 9e3a555

Please sign in to comment.