From 534b6adeb01fdb9a2289b58db018fe994a6a689b Mon Sep 17 00:00:00 2001 From: Ghost_chu <2908803755@qq.com> Date: Fri, 7 Jun 2019 15:21:31 +0800 Subject: [PATCH] Fix NPE Former-commit-id: 51eee00104da232650048c4e853f26852d1a1db8 [formerly a8ca85d088969b01131000387673d080d657dea9] Former-commit-id: 6322b99037894d5e5969615d64401d0a9be25e08 --- src/main/java/org/maxgamer/quickshop/Shop/Info.java | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/src/main/java/org/maxgamer/quickshop/Shop/Info.java b/src/main/java/org/maxgamer/quickshop/Shop/Info.java index c35a6b04c..ae3f3cdff 100644 --- a/src/main/java/org/maxgamer/quickshop/Shop/Info.java +++ b/src/main/java/org/maxgamer/quickshop/Shop/Info.java @@ -15,23 +15,22 @@ public class Info { private Block last; private Shop shop; - public Info(@NotNull Location loc, @NotNull ShopAction action, @NotNull ItemStack item, @NotNull Block last) { + public Info(@NotNull Location loc, @NotNull ShopAction action, @Nullable ItemStack item, @NotNull Block last) { this.loc = loc; this.action = action; this.last = last; - // if (item != null) - this.item = item.clone(); + if (item != null) + this.item = item.clone(); } - public Info(@NotNull Location loc, @NotNull ShopAction action, @NotNull ItemStack item, @NotNull Block last, @NotNull Shop shop) { + public Info(@NotNull Location loc, @NotNull ShopAction action, @Nullable ItemStack item, @NotNull Block last, @Nullable Shop shop) { this.loc = loc; this.action = action; this.last = last; - // if (item != null) + if (item != null) this.item = item.clone(); - // if (shop != null) { + if (shop != null) this.shop = shop.clone(); - // } } /**