diff --git a/SpigotCore_Main/src/de/steamwar/inventory/SWInventory.java b/SpigotCore_Main/src/de/steamwar/inventory/SWInventory.java index e653ba8..83314b4 100644 --- a/SpigotCore_Main/src/de/steamwar/inventory/SWInventory.java +++ b/SpigotCore_Main/src/de/steamwar/inventory/SWInventory.java @@ -74,7 +74,11 @@ public class SWInventory implements Listener { public void setItem(int pos, ItemStack itemStack, InvCallback c) { inventory.setItem(pos, itemStack); - callbacks.put(pos, inventoryClickEvent -> c.clicked(inventoryClickEvent.getClick())); + if(c != null) { + callbacks.put(pos, inventoryClickEvent -> c.clicked(inventoryClickEvent.getClick())); + } else { + callbacks.remove(pos); + } } public void setItem(int pos, SWItem item) {