From e56920c7b16cd66bd57885513a1916e873ffeb38 Mon Sep 17 00:00:00 2001 From: EnZaXD Date: Tue, 9 Jul 2024 17:59:06 +0200 Subject: [PATCH] Fix possible BannerHandler NPE in 1.13->1.12.2 (#814) --- .../v1_13to1_12_2/block_entity_handlers/BannerHandler.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/common/src/main/java/com/viaversion/viabackwards/protocol/v1_13to1_12_2/block_entity_handlers/BannerHandler.java b/common/src/main/java/com/viaversion/viabackwards/protocol/v1_13to1_12_2/block_entity_handlers/BannerHandler.java index 7c107050..17cfdeb2 100644 --- a/common/src/main/java/com/viaversion/viabackwards/protocol/v1_13to1_12_2/block_entity_handlers/BannerHandler.java +++ b/common/src/main/java/com/viaversion/viabackwards/protocol/v1_13to1_12_2/block_entity_handlers/BannerHandler.java @@ -51,7 +51,9 @@ public class BannerHandler implements BackwardsBlockEntityHandler { if (patternsTag != null) { for (CompoundTag pattern : patternsTag) { NumberTag colorTag = pattern.getNumberTag("Color"); - pattern.putInt("Color", 15 - colorTag.asInt()); // Invert color id + if (colorTag != null) { + pattern.putInt("Color", 15 - colorTag.asInt()); // Invert color id + } } }