Fix out-of-range check.
This commit is contained in:
parent
7313ac0d73
commit
c2d637b109
@ -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
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user