From 6803336b4e4ae250a885638fd212111dac4647f4 Mon Sep 17 00:00:00 2001 From: Ghost_chu <2908803755@qq.com> Date: Fri, 3 Jan 2020 19:12:09 +0800 Subject: [PATCH] Optimize logic for inventory check to prevent broke the plugin gui Former-commit-id: b928c002bd8086a8ce33d98511678dc28335a336 --- src/main/java/org/maxgamer/quickshop/Util/Util.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/main/java/org/maxgamer/quickshop/Util/Util.java b/src/main/java/org/maxgamer/quickshop/Util/Util.java index d97473d66..517e263fd 100644 --- a/src/main/java/org/maxgamer/quickshop/Util/Util.java +++ b/src/main/java/org/maxgamer/quickshop/Util/Util.java @@ -645,6 +645,10 @@ public class Util { if (inv == null) { return; } + if(inv.getHolder() == null){ + Util.debugLog("Skipped plugin gui inventory check."); + return; + } new BukkitRunnable() { @Override public void run() { @@ -661,7 +665,7 @@ public class Util { return; //Virtual GUI } plugin.getSyncTaskWatcher().getInventoryEditQueue() - .offer(new InventoryEditContainer(inv, i, new ItemStack(Material.AIR, 0))); + .offer(new InventoryEditContainer(inv, i, new ItemStack(Material.AIR))); Util.debugLog("Found a displayitem in an inventory, Scheduling to removeal..."); MsgUtil.sendGlobalAlert("[InventoryCheck] Found displayItem in inventory at " + location + ", Item is " + itemStack .getType().name());