Skip to content

Commit

Permalink
avoid IndexOutOfBoundsException
Browse files Browse the repository at this point in the history
  • Loading branch information
thiakil committed Dec 20, 2024
1 parent 143d68d commit aa708cd
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ public void setModule(@Nullable Module<?> module) {
EnumToggle<?> toggle = createEnumToggle(configItem, 2, startY, i);
element = toggle;
// allow the dragger to continue sliding, even when we reset the config element
if (currentModule != null && currentModule.getData() == module.getData() && miniElements.get(i) instanceof EnumToggle<?> enumToggle) {
if (currentModule != null && currentModule.getData() == module.getData() && i < miniElements.size() && miniElements.get(i) instanceof EnumToggle<?> enumToggle) {
toggle.dragging = enumToggle.dragging;
}
} else if (configItem.getData() instanceof ModuleColorData data) {
Expand Down

0 comments on commit aa708cd

Please sign in to comment.