From aa708cdcc258ad09c57775ec3f1ffc66459eb207 Mon Sep 17 00:00:00 2001 From: Thiakil Date: Fri, 20 Dec 2024 21:25:58 +0800 Subject: [PATCH] avoid IndexOutOfBoundsException --- .../client/gui/element/custom/module/GuiModuleScreen.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/mekanism/client/gui/element/custom/module/GuiModuleScreen.java b/src/main/java/mekanism/client/gui/element/custom/module/GuiModuleScreen.java index 248b05b0349..2e4124da834 100644 --- a/src/main/java/mekanism/client/gui/element/custom/module/GuiModuleScreen.java +++ b/src/main/java/mekanism/client/gui/element/custom/module/GuiModuleScreen.java @@ -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) {