From 385ca981253a9f52c5e62d6f2cab26bc89b45e89 Mon Sep 17 00:00:00 2001 From: KennyTV Date: Thu, 25 Jun 2020 14:30:05 +0200 Subject: [PATCH] Fix NPE Fixes #211 --- .../packets/BlockItemPackets1_16.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/core/src/main/java/nl/matsv/viabackwards/protocol/protocol1_15_2to1_16/packets/BlockItemPackets1_16.java b/core/src/main/java/nl/matsv/viabackwards/protocol/protocol1_15_2to1_16/packets/BlockItemPackets1_16.java index 22157ccf..f7e7999e 100644 --- a/core/src/main/java/nl/matsv/viabackwards/protocol/protocol1_15_2to1_16/packets/BlockItemPackets1_16.java +++ b/core/src/main/java/nl/matsv/viabackwards/protocol/protocol1_15_2to1_16/packets/BlockItemPackets1_16.java @@ -244,10 +244,10 @@ public class BlockItemPackets1_16 extends nl.matsv.viabackwards.api.rewriters.It Tag skullOwnerTag = tag.remove("SkullOwner"); if (!(skullOwnerTag instanceof CompoundTag)) return; - CompoundTag skullOwnerCompoundTag = tag.remove("SkullOwner"); - IntArrayTag ownerUuidTag = skullOwnerCompoundTag.remove("Id"); - if (ownerUuidTag != null) { - UUID ownerUuid = UUIDIntArrayType.uuidFromIntArray(ownerUuidTag.getValue()); + CompoundTag skullOwnerCompoundTag = (CompoundTag) skullOwnerTag; + Tag ownerUuidTag = skullOwnerCompoundTag.remove("Id"); + if (ownerUuidTag instanceof IntArrayTag) { + UUID ownerUuid = UUIDIntArrayType.uuidFromIntArray((int[]) ownerUuidTag.getValue()); skullOwnerCompoundTag.put(new StringTag("Id", ownerUuid.toString())); }