mirror of
https://github.com/PikaMug/Quests.git
synced 2024-12-24 01:58:42 +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() != "") {
|
if (flags[0] != null && flags[0].toString() != "") {
|
||||||
for (ItemFlag flag : flags) {
|
for (ItemFlag flag : flags) {
|
||||||
|
if (flag != null) {
|
||||||
|
try {
|
||||||
meta.addItemFlags(flag);
|
meta.addItemFlags(flag);
|
||||||
|
} catch (NullPointerException npe) {
|
||||||
|
Bukkit.getLogger().severe(flag + " is not a valid ItemFlag");
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (stack.getType().equals(Material.ENCHANTED_BOOK)) {
|
if (stack.getType().equals(Material.ENCHANTED_BOOK)) {
|
||||||
|
Loading…
Reference in New Issue
Block a user