Skip to content

Commit

Permalink
add fix for if a ClickableItem doesnt have a ClickEvent bound
Browse files Browse the repository at this point in the history
  • Loading branch information
Burchard36 committed Dec 12, 2021
1 parent dbee5b9 commit 654401a
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/main/java/com/burchard36/inventory/PluginInventory.java
Original file line number Diff line number Diff line change
Expand Up @@ -203,6 +203,10 @@ public void onClickEvent(final InventoryClickEvent event) {
if (this.clickableItems.get(event.getSlot()) != null) {
final ClickableItem clickableItem = this.clickableItems.get(event.getSlot());
final ClickableItemAction clickableItemAction = new ClickableItemAction(event);
if (clickableItem.guiClickableItem == null) {
event.setCancelled(true);
return;
}
clickableItem.guiClickableItem.onItemClick(clickableItemAction);

if (clickableItemAction.isCancelled()) event.setCancelled(true);
Expand Down

0 comments on commit 654401a

Please sign in to comment.