From d54d50725cf5dff235a41a46819fb00f67377833 Mon Sep 17 00:00:00 2001 From: BuildTools Date: Thu, 6 Dec 2018 16:17:15 -0500 Subject: [PATCH] Ensure ItemFlag is valid and not null, fixes #560 --- src/main/java/me/blackvein/quests/util/ItemUtil.java | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/main/java/me/blackvein/quests/util/ItemUtil.java b/src/main/java/me/blackvein/quests/util/ItemUtil.java index 0bdfdeaf7..c5d269d89 100644 --- a/src/main/java/me/blackvein/quests/util/ItemUtil.java +++ b/src/main/java/me/blackvein/quests/util/ItemUtil.java @@ -257,7 +257,13 @@ public class ItemUtil { } if (flags[0] != null && flags[0].toString() != "") { for (ItemFlag flag : flags) { - meta.addItemFlags(flag); + if (flag != null) { + try { + meta.addItemFlags(flag); + } catch (NullPointerException npe) { + Bukkit.getLogger().severe(flag + " is not a valid ItemFlag"); + } + } } } if (stack.getType().equals(Material.ENCHANTED_BOOK)) {