Fix out-of-range check.

This commit is contained in:
Kistaro Windrider 2023-04-03 20:25:29 -07:00
parent 7313ac0d73
commit c2d637b109
Signed by: kistaro
SSH Key Fingerprint: SHA256:TBE2ynfmJqsAf0CP6gsflA0q5X5wD5fVKWPsZ7eVUg8

View File

@ -257,7 +257,7 @@ func (v *VerbosePolicy) fillDefaults() {
for len(v.Variants) <= v.lastIdx { for len(v.Variants) <= v.lastIdx {
v.Variants = append(v.Variants, v.Default) v.Variants = append(v.Variants, v.Default)
} }
if v.Variants[v.lastIdx] == nil { if v.lastIdx > 0 && v.Variants[v.lastIdx] == nil {
v.Variants[v.lastIdx] = v.Default v.Variants[v.lastIdx] = v.Default
} }
} }