aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorhannibal2 <24389977+hannibal002@users.noreply.github.com>2023-02-15 18:50:09 +0100
committerGitHub <noreply@github.com>2023-02-15 18:50:09 +0100
commite0ab2af457daf50b838248afbc4110c97a0c8b4a (patch)
tree7622419d2c9291e01cd36ac16bd0b8c558976f03
parent6b0ab49a2cfc31daee3552861aae847a5d42f9d6 (diff)
downloadNotEnoughUpdates-e0ab2af457daf50b838248afbc4110c97a0c8b4a.tar.gz
NotEnoughUpdates-e0ab2af457daf50b838248afbc4110c97a0c8b4a.tar.bz2
NotEnoughUpdates-e0ab2af457daf50b838248afbc4110c97a0c8b4a.zip
Workaround for NEUOverlay crash (#615)
* Workaround for IndexOutOfBoundsException in NEUOverlay * -1 line --------- Co-authored-by: hannibal2 <24389977+hannibal00212@users.noreply.github.com>
-rw-r--r--src/main/java/io/github/moulberry/notenoughupdates/NEUOverlay.java9
1 files changed, 8 insertions, 1 deletions
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<JsonObject> 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;
}