Skip to content

Commit ca1421c

Browse files
authored
Merge pull request #7 from laravel-upgrade-helper/fix-latest-major-version-selection-bug
fix finding lastIndex
2 parents 296c7b8 + 0b9bbf3 commit ca1421c

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

index.html

+3-1
Original file line numberDiff line numberDiff line change
@@ -237,7 +237,9 @@ <h3 class="text-xl font-semibold text-gray-900 dark:text-white">
237237
) === -1
238238
});
239239

240-
const lastIndex = this.tags.indexOf(sameVersionTags[sameVersionTags.length - 1])
240+
const lastIndex = sameVersionTags.length > 0 ?
241+
this.tags.indexOf(sameVersionTags[sameVersionTags.length - 1]) :
242+
this.tags.indexOf(this.baseVersion)
241243

242244
if (lastIndex < this.tags.length - 1) {
243245
sameVersionTags.push(this.tags[lastIndex + 1])

0 commit comments

Comments
 (0)