if (stateReductionMode) {
// Update vodGraph
int currChoice = choiceCounter - 1;
- if (currChoice < 0 || choices[currChoice] == -1 || prevChoiceValue == choices[currChoice]) {
- // Current choice has to be at least 0 (initial case can be -1)
+ if (currChoice < 0 || currChoice > choices.length - 1 || choices[currChoice] == -1 || prevChoiceValue == choices[currChoice]) {
+ // Handle all corner cases (e.g., out of bound values)
return;
}
// When current choice is 0, previous choice could be -1