From e0ab2af457daf50b838248afbc4110c97a0c8b4a Mon Sep 17 00:00:00 2001 From: hannibal2 <24389977+hannibal002@users.noreply.github.com> Date: Wed, 15 Feb 2023 18:50:09 +0100 Subject: Workaround for NEUOverlay crash (#615) * Workaround for IndexOutOfBoundsException in NEUOverlay * -1 line --------- Co-authored-by: hannibal2 <24389977+hannibal00212@users.noreply.github.com> --- .../java/io/github/moulberry/notenoughupdates/NEUOverlay.java | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'src/main/java/io') diff --git a/src/main/java/io/github/moulberry/notenoughupdates/NEUOverlay.java b/src/main/java/io/github/moulberry/notenoughupdates/NEUOverlay.java index 7159ef89..927b5e76 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/NEUOverlay.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/NEUOverlay.java @@ -1500,7 +1500,14 @@ public class NEUOverlay extends Gui { int actualIndex = index + getSlotsXSize() * getSlotsYSize() * page; List searchedItems = getSearchedItems(); if (0 <= actualIndex && actualIndex < searchedItems.size()) { - return searchedItems.get(actualIndex); + try { + return searchedItems.get(actualIndex); + } catch (IndexOutOfBoundsException e) { + System.out.println("searchedItems size: " + searchedItems.size()); + System.out.println("actualIndex: " + actualIndex); + e.printStackTrace(); + return null; + } } else { return null; } -- cgit