Fix NullPointerException

This commit is contained in:
filoghost 2020-07-12 10:54:12 +02:00
parent 556ef481a2
commit 1379ce344a

View File

@ -78,7 +78,7 @@ public abstract class BaseIconMenu implements IconMenu {
public void refreshOpenInventories() { public void refreshOpenInventories() {
for (Player player : Bukkit.getOnlinePlayers()) { for (Player player : Bukkit.getOnlinePlayers()) {
DefaultItemInventory itemInventory = MenuManager.getOpenItemInventory(player); DefaultItemInventory itemInventory = MenuManager.getOpenItemInventory(player);
if (itemInventory.getIconMenu() == this) { if (itemInventory != null && itemInventory.getIconMenu() == this) {
itemInventory.refresh(); itemInventory.refresh();
} }
} }