From b9a60dcee6050cb69cbab2f43da0ca5b89ea0ecb Mon Sep 17 00:00:00 2001 From: LoJoSho Date: Wed, 4 Jan 2023 10:47:59 -0600 Subject: [PATCH] item null check --- .../hibiscusmc/hmccosmetics/listener/PlayerGameListener.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/common/src/main/java/com/hibiscusmc/hmccosmetics/listener/PlayerGameListener.java b/common/src/main/java/com/hibiscusmc/hmccosmetics/listener/PlayerGameListener.java index 360a6370..8454ad92 100644 --- a/common/src/main/java/com/hibiscusmc/hmccosmetics/listener/PlayerGameListener.java +++ b/common/src/main/java/com/hibiscusmc/hmccosmetics/listener/PlayerGameListener.java @@ -59,7 +59,9 @@ public class PlayerGameListener implements Listener { //if (event.getSlotType() != InventoryType.SlotType.ARMOR) return; CosmeticUser user = CosmeticUsers.getUser(event.getWhoClicked().getUniqueId()); if (user == null) return; - EquipmentSlot slot = getArmorSlot(event.getCurrentItem().getType()); + ItemStack item = event.getCurrentItem(); + if (item == null) return; + EquipmentSlot slot = getArmorSlot(item.getType()); if (slot == null) return; CosmeticSlot cosmeticSlot = InventoryUtils.BukkitCosmeticSlot(slot); if (cosmeticSlot == null) return;