Fixed NPE

This commit is contained in:
Lilac 2019-08-02 20:46:11 +01:00
parent d902a71857
commit e257f2a045

View File

@ -11,6 +11,7 @@ import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
import org.bukkit.event.inventory.InventoryClickEvent;
import org.bukkit.event.inventory.InventoryType;
import org.bukkit.event.player.AsyncPlayerChatEvent;
import org.bukkit.inventory.Inventory;
import org.bukkit.inventory.ItemStack;
@ -35,6 +36,7 @@ public class SettingsManager implements Listener {
@EventHandler
public void onInventoryClick(InventoryClickEvent event) {
if (event.getView().getType() != InventoryType.CHEST) return;
ItemStack clickedItem = event.getCurrentItem();
if (event.getInventory() != event.getWhoClicked().getOpenInventory().getTopInventory()