Finally fixed NPEs in PanelListenerManager tests (#765)

Tests failing because 'getClickedInventory()' was not defined there
This commit is contained in:
BONNe 2019-06-14 15:57:32 +03:00 committed by Florian CUNY
parent 492361663e
commit 673436a5b7

View File

@ -33,7 +33,7 @@ public class PanelListenerManager implements Listener {
// Open the inventory panel that this player has open (they can only ever have one) // Open the inventory panel that this player has open (they can only ever have one)
if (openPanels.containsKey(user.getUniqueId()) && if (openPanels.containsKey(user.getUniqueId()) &&
openPanels.get(user.getUniqueId()).getInventory().equals(event.getClickedInventory())) { openPanels.get(user.getUniqueId()).getInventory().equals(event.getInventory())) {
// Cancel the event. If they don't want it to be cancelled then the click handler(s) should // Cancel the event. If they don't want it to be cancelled then the click handler(s) should
// uncancel it. If gui was from our environment, then cancel event anyway. // uncancel it. If gui was from our environment, then cancel event anyway.
event.setCancelled(true); event.setCancelled(true);