diff options
author | NopoTheGamer <40329022+NopoTheGamer@users.noreply.github.com> | 2022-10-19 12:12:40 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-10-19 14:12:40 +0200 |
commit | a465173177f859f193ba014c77f0e10e7b9112e4 (patch) | |
tree | 732defff144b7eac03b3158a4af228190e50394c /src/main/java/io | |
parent | abe0de1d3e0a6fbc0d43c51cd5371189fda27e16 (diff) | |
download | NotEnoughUpdates-a465173177f859f193ba014c77f0e10e7b9112e4.tar.gz NotEnoughUpdates-a465173177f859f193ba014c77f0e10e7b9112e4.tar.bz2 NotEnoughUpdates-a465173177f859f193ba014c77f0e10e7b9112e4.zip |
Fix crash when a list config option doesnt have that many options (generally from downgrading) (#371)
Diffstat (limited to 'src/main/java/io')
-rw-r--r-- | src/main/java/io/github/moulberry/notenoughupdates/core/config/gui/GuiOptionEditorDraggableList.java | 4 |
1 files changed, 4 insertions, 0 deletions
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; } |