9
0
mirror of https://github.com/HibiscusMC/HMCCosmetics.git synced 2025-12-26 18:39:07 +00:00

item null check

This commit is contained in:
LoJoSho
2023-01-04 10:47:59 -06:00
parent 59f02d4d15
commit b9a60dcee6

View File

@@ -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;