WesJD / AnvilGUI

Capture user input in Minecraft through an anvil GUI in under 20 lines of code
MIT License
466 stars 111 forks source link

AnvilGUI.ListenUp.onInventoryClick - NullPointerException #308

Closed BartoszKonkol closed 7 months ago

BartoszKonkol commented 7 months ago

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) ~[?:?]