From 84208d095e2e04836d8b1aa7fa7a23eeb94f8736 Mon Sep 17 00:00:00 2001 From: Cedric Date: Mon, 23 Oct 2023 11:58:55 +0200 Subject: [PATCH] fix: ArrayIndexOutOfBounds --- .../java/com/troblecodings/signals/guis/GuiSignalBox.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/troblecodings/signals/guis/GuiSignalBox.java b/src/main/java/com/troblecodings/signals/guis/GuiSignalBox.java index 92a2c9f1c..bee5e19d3 100644 --- a/src/main/java/com/troblecodings/signals/guis/GuiSignalBox.java +++ b/src/main/java/com/troblecodings/signals/guis/GuiSignalBox.java @@ -443,7 +443,7 @@ private void setupModeSettings(final UIEntity parent, final EnumGuiMode mode, return point.toShortString(); })); parent.add(GuiElements.createEnumElement(integerable, e -> { - final Point point = validInConnections.get(e); + final Point point = e >= 0 ? validInConnections.get(e) : null; if (point == null) { option.removeEntry(PathEntryType.POINT); removeEntryFromServer(node, mode, rotation, PathEntryType.POINT); @@ -467,7 +467,7 @@ private void setupModeSettings(final UIEntity parent, final EnumGuiMode mode, return point.toShortString(); })); parent.add(GuiElements.createEnumElement(integerable, e -> { - final Point point = validEnds.get(e); + final Point point = e >= 0 ? validEnds.get(e) : null; if (point == null) { option.removeEntry(PathEntryType.POINT); removeEntryFromServer(node, mode, rotation, PathEntryType.POINT);