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) {