From 1c0a56402f8773f750dbc5192f604f4f6157d941 Mon Sep 17 00:00:00 2001 From: iceBear67 Date: Wed, 16 Oct 2024 10:59:20 +0800 Subject: [PATCH] Fix: selection gui throws an exception when players clicked nowhere --- src/main/java/dev/tylerm/khs/gui/SkillSelectionGUI.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/dev/tylerm/khs/gui/SkillSelectionGUI.java b/src/main/java/dev/tylerm/khs/gui/SkillSelectionGUI.java index 6abe8af..20871c1 100644 --- a/src/main/java/dev/tylerm/khs/gui/SkillSelectionGUI.java +++ b/src/main/java/dev/tylerm/khs/gui/SkillSelectionGUI.java @@ -56,7 +56,7 @@ void onClick(InventoryClickEvent event) { return; } event.setCancelled(true); - if(event.getRawSlot() > gui.skills.size())return; + if(event.getRawSlot() < 0 || event.getRawSlot() > gui.skills.size())return; var skill = gui.skills.get(event.getRawSlot()); if (skill == null) { return;