Added check for block without items

Simple null check, may fix #2007
This commit is contained in:
HenryLoenwind committed 2015-02-25 01:24:02 +01:00
1 parent 19c73082d3
commit 5c5b2a3886
1 file changed
+5 -2
@@ -57,8 +57,11 @@ public final class PainterUtil {
Block sourceId = PainterUtil.getSourceBlock(item);
int meta = PainterUtil.getSourceBlockMetadata(item);
if(sourceId != null) {
ItemStack is = new ItemStack(Item.getItemFromBlock(sourceId), 1, meta);
sourceName = is.getDisplayName();
Item itemFromBlock = Item.getItemFromBlock(sourceId);
if (itemFromBlock != null) {
ItemStack is = new ItemStack(itemFromBlock, 1, meta);
sourceName = is.getDisplayName();
}
}
return Lang.localize("blockPainter.paintedWith") + " " + sourceName;
}