WesJD / AnvilGUI

Capture user input in Minecraft through an anvil GUI in under 20 lines of code

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

AnvilGUI.ListenUp.onInventoryClick - NullPointerException

BartoszKonkol opened this issue · comments

In the "AnvilGUI.ListenUp" class in the "onInventoryClick" method in lines 309 and 315, calls method "equals" without checking whether "event.getClickedInventory()" is null (unlike line 292 which checks), this causes an error in some situations.

Caused by: java.lang.NullPointerException: Cannot invoke "org.bukkit.inventory.Inventory.equals(Object)" because the return value of "org.bukkit.event.inventory.InventoryClickEvent.getClickedInventory()" is null at net.wesjd.anvilgui.AnvilGUI$ListenUp.onInventoryClick(AnvilGUI.java:309) ~[?:?]