only: better validation

This commit is contained in:
rusefillc 2023-10-26 13:02:15 -04:00
parent 198609ecaf
commit 46c5923f25
1 changed files with 1 additions and 1 deletions

View File

@ -74,7 +74,7 @@ public class EnumConfigField extends BaseConfigField {
item = "unexpected_" + ordinal;
view.addItem(item);
} else {
if (ordinal >= options.length)
if (ordinal < 0 || ordinal >= options.length)
throw new UnexpectedEnumOridnalException(ordinal + " unexpected on " + field);
item = options[ordinal];
}