null pointer check

Former-commit-id: b9c7bacdba1795b042cd58ea4885fb589d1e5691 [formerly 132c7468395775a07c11f5f3f02c317c77df9c24]
Former-commit-id: eec6f935e37bb3bdd2581e00b8af811255144f7f
This commit is contained in:
Ghost_chu committed 2019-05-13 23:08:48 +08:00
1 parent 18a2038e65
commit 3536067a63
1 file changed
+3
@@ -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<String> lores = stack.getItemMeta().getLore();