From a465173177f859f193ba014c77f0e10e7b9112e4 Mon Sep 17 00:00:00 2001 From: NopoTheGamer <40329022+NopoTheGamer@users.noreply.github.com> Date: Wed, 19 Oct 2022 12:12:40 +0000 Subject: Fix crash when a list config option doesnt have that many options (generally from downgrading) (#371) --- .../core/config/gui/GuiOptionEditorDraggableList.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/main/java/io/github/moulberry/notenoughupdates/core/config/gui/GuiOptionEditorDraggableList.java b/src/main/java/io/github/moulberry/notenoughupdates/core/config/gui/GuiOptionEditorDraggableList.java index 63a932b5..d3b9c04d 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/core/config/gui/GuiOptionEditorDraggableList.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/core/config/gui/GuiOptionEditorDraggableList.java @@ -72,6 +72,10 @@ public class GuiOptionEditorDraggableList extends GuiOptionEditor { int height = super.getHeight() + 13; for (int strIndex : activeText) { + if (strIndex >= exampleText.length) { + activeText.remove((Integer) strIndex); + break; + } String str = exampleText[strIndex]; height += 10 * str.split("\n").length; } -- cgit