Skip to content

Commit 62c9289

Browse files
fix: index out of range bug (#289)
The for loop condition needs to depend on the RANGE, otherwise it the index will go out of range when we access i + RANGE - 1 inside the for loop. Signed-off-by: Harikrishnan Balagopal <harikrishmenon@gmail.com>
1 parent 8c5affc commit 62c9289

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

lib/src/Gren.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -536,7 +536,7 @@ class Gren {
536536
const labels = Array.from(issue.labels);
537537

538538
if (!labels.length && this.options.template.noLabel) {
539-
labels.push({name: this.options.template.noLabel});
539+
labels.push({ name: this.options.template.noLabel });
540540
}
541541

542542
return labels
@@ -804,7 +804,7 @@ class Gren {
804804
return;
805805
}
806806

807-
issue.labels.push({name: this.options.template.noLabel});
807+
issue.labels.push({ name: this.options.template.noLabel });
808808
}
809809

810810
const labelName = issue.labels[0].name;
@@ -849,7 +849,7 @@ class Gren {
849849
const groups = Object.keys(groupBy).reduce((carry, group, i, arr) => {
850850
const groupIssues = issues.filter(issue => {
851851
if (!issue.labels.length && this.options.template.noLabel) {
852-
issue.labels.push({name: this.options.template.noLabel});
852+
issue.labels.push({ name: this.options.template.noLabel });
853853
}
854854

855855
return issue.labels.some(label => {
@@ -1093,7 +1093,7 @@ class Gren {
10931093
});
10941094
}
10951095

1096-
for (let i = 0; i < sortedReleaseDates.length - 1; i++) {
1096+
for (let i = 0; i < sortedReleaseDates.length - RANGE + 1; i++) {
10971097
const until = sortedReleaseDates[i + 1].date;
10981098
ranges.push([
10991099
sortedReleaseDates[i],

0 commit comments

Comments
 (0)