From 2c12f78aa63daaca6ee24176f392f130a90b0619 Mon Sep 17 00:00:00 2001 From: Auxilor Date: Wed, 21 Jul 2021 21:45:59 +0100 Subject: [PATCH] Fixed 'Menu not instance of EcoMenu!' bug --- .../src/main/java/com/willfp/eco/spigot/gui/GUIListener.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/eco-core/core-plugin/src/main/java/com/willfp/eco/spigot/gui/GUIListener.java b/eco-core/core-plugin/src/main/java/com/willfp/eco/spigot/gui/GUIListener.java index 4b8ea4dd7..b11544db3 100644 --- a/eco-core/core-plugin/src/main/java/com/willfp/eco/spigot/gui/GUIListener.java +++ b/eco-core/core-plugin/src/main/java/com/willfp/eco/spigot/gui/GUIListener.java @@ -54,6 +54,10 @@ public void handleClose(@NotNull final InventoryCloseEvent event) { Menu menu = MenuHandler.getMenu(event.getInventory()); + if (menu == null) { + return; + } + Validate.isTrue(menu instanceof EcoMenu, "Menu not instance of EcoMenu!"); EcoMenu ecoMenu = (EcoMenu) menu;