mirror of
https://github.com/PikaMug/Quests.git
synced 2024-12-18 15:18:34 +01:00
Ensure ItemFlag is valid and not null, fixes #560
This commit is contained in:
parent
6c9d019296
commit
d54d50725c
@ -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)) {
|
||||
|
Loading…
Reference in New Issue
Block a user