diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/main/java/org/bukkit/inventory/ItemStack.java | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/main/java/org/bukkit/inventory/ItemStack.java b/src/main/java/org/bukkit/inventory/ItemStack.java index 87cd9ca6..d8256fca 100644 --- a/src/main/java/org/bukkit/inventory/ItemStack.java +++ b/src/main/java/org/bukkit/inventory/ItemStack.java @@ -122,8 +122,9 @@ public class ItemStack implements ConfigurationSerializable { * @return MaterialData for this item */ public MaterialData getData() { - if (Material.getMaterial(getTypeId()).getData() != null) { - data = Material.getMaterial(getTypeId()).getNewData((byte) this.durability); + Material mat = Material.getMaterial(getTypeId()); + if (mat != null && mat.getData() != null) { + data = mat.getNewData((byte) this.durability); } return data; |