fix array index out of bounds

This commit is contained in:
yugecin 2016-11-13 03:07:46 +01:00
parent b722808d70
commit b969946fc4

View File

@ -134,7 +134,7 @@ public class OptionsOverlay {
return true; return true;
} }
int idx = getOptionIdxAt(y); int idx = getOptionIdxAt(y);
if (idx < options.length) { if (idx >= 0 && idx < options.length) {
final Options.GameOption option = options[idx]; final Options.GameOption option = options[idx];
selectedOption = option; selectedOption = option;
Object[] listItems = option.getListItems(); Object[] listItems = option.getListItems();