diff --git a/src/main/java/net/coreprotect/listener/player/InventoryChangeListener.java b/src/main/java/net/coreprotect/listener/player/InventoryChangeListener.java index 01082e04..2cbdf35b 100644 --- a/src/main/java/net/coreprotect/listener/player/InventoryChangeListener.java +++ b/src/main/java/net/coreprotect/listener/player/InventoryChangeListener.java @@ -294,11 +294,11 @@ protected void onInventoryDragEvent(InventoryDragEvent event) { boolean enderChest = false; Inventory inventory = event.getInventory(); - if (inventory == null || inventory.equals(event.getWhoClicked().getInventory())) { + InventoryHolder inventoryHolder = inventory.getHolder(); + if (inventory == null || inventoryHolder != null && inventoryHolder.equals(event.getWhoClicked())) { return; } - InventoryHolder inventoryHolder = inventory.getHolder(); enderChest = inventory.equals(event.getWhoClicked().getEnderChest()); if ((inventoryHolder != null && (inventoryHolder instanceof BlockInventoryHolder || inventoryHolder instanceof DoubleChest)) || enderChest) { movedItem = true;