From 0fb9202a79289200bc73b6c468d109c50eb1f5f5 Mon Sep 17 00:00:00 2001 From: Roman / Nea Date: Wed, 19 Jan 2022 02:24:22 +0100 Subject: fix weird NPE (#66) --- .../io/github/moulberry/notenoughupdates/miscgui/TradeWindow.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/main/java/io/github/moulberry/notenoughupdates/miscgui/TradeWindow.java b/src/main/java/io/github/moulberry/notenoughupdates/miscgui/TradeWindow.java index fda6dd03..ecf58976 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/miscgui/TradeWindow.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/miscgui/TradeWindow.java @@ -944,8 +944,8 @@ public class TradeWindow { int x = i % 4; int y = i / 4; - int containerIndex = ourTradeIndexes[i]; - if (containerIndex < 0) continue; + Integer containerIndex = ourTradeIndexes[i]; + if (containerIndex == null || containerIndex < 0) continue; if (mouseX > guiLeft + 10 + x * 18 - 1 && mouseX < guiLeft + 10 + x * 18 + 18) { if (mouseY > guiTop + 15 + y * 18 - 1 && mouseY < guiTop + 15 + y * 18 + 18) { -- cgit