Skip to content

Commit

Permalink
Fix ItemFlags NPE
Browse files Browse the repository at this point in the history
  • Loading branch information
Morphan1 committed Apr 30, 2015
1 parent 315f9c9 commit 398b369
Showing 1 changed file with 6 additions and 2 deletions.
Expand Up @@ -8,6 +8,7 @@
import net.aufdemrand.denizencore.objects.properties.Property;
import net.aufdemrand.denizencore.tags.Attribute;
import org.bukkit.inventory.ItemFlag;
import org.bukkit.inventory.ItemStack;
import org.bukkit.inventory.meta.ItemMeta;

public class ItemFlags implements Property {
Expand All @@ -28,8 +29,11 @@ private ItemFlags(dItem _item) {

public dList flags() {
dList output = new dList();
for (ItemFlag flag: item.getItemStack().getItemMeta().getItemFlags()) {
output.add(flag.name());
ItemStack itemStack = item.getItemStack();
if (itemStack.hasItemMeta()) {
for (ItemFlag flag : itemStack.getItemMeta().getItemFlags()) {
output.add(flag.name());
}
}
return output;
}
Expand Down

0 comments on commit 398b369

Please sign in to comment.