mirror of
https://github.com/packwiz/packwiz.git
synced 2025-04-19 13:06:30 +02:00
Fix out of bounds array access in acceptable-versions command
This commit is contained in:
parent
e8c28ae57e
commit
41465407b2
@ -104,7 +104,7 @@ var acceptableVersionsCommand = &cobra.Command{
|
||||
// If it's only 1 element long, then it's already sorted
|
||||
if len(acceptableVersionsDeduped) > 1 {
|
||||
for i, v := range acceptableVersionsDeduped {
|
||||
if flexver.Less(acceptableVersionsDeduped[i+1], v) {
|
||||
if i+1 < len(acceptableVersionsDeduped) && flexver.Less(acceptableVersionsDeduped[i+1], v) {
|
||||
fmt.Printf("Warning: Your acceptable versions list is out of order. ")
|
||||
// Give a do you mean example
|
||||
// Clone the list
|
||||
|
Loading…
x
Reference in New Issue
Block a user