From ac33966e683ca91354feb3b719070ea9ef0a2c70 Mon Sep 17 00:00:00 2001 From: RecursivePineapple Date: Sat, 28 Sep 2024 07:56:06 -0400 Subject: [PATCH] Fixed NPE when holding a frame w/ missing material (#3294) --- src/main/java/gregtech/common/blocks/ItemFrames.java | 1 + 1 file changed, 1 insertion(+) diff --git a/src/main/java/gregtech/common/blocks/ItemFrames.java b/src/main/java/gregtech/common/blocks/ItemFrames.java index daa6ca2d2eb..ef40c21928b 100644 --- a/src/main/java/gregtech/common/blocks/ItemFrames.java +++ b/src/main/java/gregtech/common/blocks/ItemFrames.java @@ -44,6 +44,7 @@ public String getItemStackDisplayName(ItemStack aStack) { public int getColorFromItemStack(ItemStack aStack, int aPass) { int meta = aStack.getItemDamage(); Materials material = BlockFrameBox.getMaterial(meta); + if (material == null) return 0; return (material.mRGBa[0] << 16) | (material.mRGBa[1] << 8) | material.mRGBa[2]; }