Fixes a NullPointerException in InventoryListeners#onInventoryClick

This commit is contained in:
Christian Koop 2022-09-18 17:48:57 +02:00
parent a623b41f98
commit 208c4fc6d6
No known key found for this signature in database
GPG Key ID: 89A8181384E010A3

View File

@ -41,7 +41,7 @@ public class InventoryListeners implements Listener {
if (event.getSlot() != 64537) {
if (event.getInventory().getType() == InventoryType.ANVIL) {
if (event.getAction() != InventoryAction.NOTHING) {
if (event.getCurrentItem().getType() != Material.AIR) {
if (event.getCurrentItem() != null && event.getCurrentItem().getType() != Material.AIR) {
ItemStack item = event.getCurrentItem();
if (item.getType().name().contains("FURNACE") && !item.getType().name().contains("SMOKER")) {
event.setCancelled(true);