From 5aa843966ac1350718dd820a85f62efac3bac002 Mon Sep 17 00:00:00 2001 From: KAMKEEL <28842281+KAMKEEL@users.noreply.github.com> Date: Tue, 11 Aug 2026 03:19:52 -0400 Subject: [PATCH] Fix divide by zero clicking the profiles scrollbar The scrollbar hit test was pure geometry, so clicking its column before the profile list had loaded - or on any list short enough not to scroll - divided by a maxScrollY of zero. The draw path already guarded on the same value. --- .../noppes/npcs/client/gui/player/inventory/GuiProfiles.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/main/java/noppes/npcs/client/gui/player/inventory/GuiProfiles.java b/src/main/java/noppes/npcs/client/gui/player/inventory/GuiProfiles.java index f9e627fe7..56777ca6f 100644 --- a/src/main/java/noppes/npcs/client/gui/player/inventory/GuiProfiles.java +++ b/src/main/java/noppes/npcs/client/gui/player/inventory/GuiProfiles.java @@ -429,6 +429,9 @@ public class GuiProfiles extends GuiCNPCInventory implements ISubGuiListener, IC } private boolean isMouseOverScrollbar(int mouseX, int mouseY) { + if (maxScrollY <= 0) + return false; + int scrollbarX = guiLeft + xSize + 30; int scrollbarY = guiTop + 27; int scrollbarHeight = ySize - 35;