From 3536067a63fa320d05aedeb64340cab467822db3 Mon Sep 17 00:00:00 2001 From: Ghost_chu <2908803755@qq.com> Date: Mon, 13 May 2019 23:08:48 +0800 Subject: [PATCH] null pointer check Former-commit-id: b9c7bacdba1795b042cd58ea4885fb589d1e5691 [formerly 132c7468395775a07c11f5f3f02c317c77df9c24] Former-commit-id: eec6f935e37bb3bdd2581e00b8af811255144f7f --- .../java/org/maxgamer/quickshop/Shop/InventoryPreview.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/main/java/org/maxgamer/quickshop/Shop/InventoryPreview.java b/src/main/java/org/maxgamer/quickshop/Shop/InventoryPreview.java index ea41b77aa..96f3a2385 100644 --- a/src/main/java/org/maxgamer/quickshop/Shop/InventoryPreview.java +++ b/src/main/java/org/maxgamer/quickshop/Shop/InventoryPreview.java @@ -19,6 +19,7 @@ public class InventoryPreview implements Listener { Player player; public InventoryPreview(ItemStack itemStack,Player player) { + this.itemStack=itemStack.clone(); this.player=player; if(this.itemStack.getItemMeta().hasLore()) { @@ -63,6 +64,8 @@ public class InventoryPreview implements Listener { } public static boolean isPreviewItem(ItemStack stack) { + if(stack==null) + return false; if(!stack.hasItemMeta()||!stack.getItemMeta().hasLore()) return false; List lores = stack.getItemMeta().getLore();