Skip to content

Commit

Permalink
Prevent crash with invalid material toolparts. #1124
Browse files Browse the repository at this point in the history
  • Loading branch information
bonii-xx committed Oct 26, 2014
1 parent 5905653 commit 71b0f65
Showing 1 changed file with 1 addition and 1 deletion.
Expand Up @@ -155,7 +155,7 @@ public int getColorFromItemStack(ItemStack stack, int renderpass) {
if(matId > icons.length)
return super.getColorFromItemStack(stack, renderpass);

if(icons[matId] == null)
if(matId >= 0 && icons[matId] == null)
return TConstructRegistry.getMaterial(matId).primaryColor();

return super.getColorFromItemStack(stack, renderpass);
Expand Down

0 comments on commit 71b0f65

Please sign in to comment.