From a1c841ce7e8b9fadad4701cd3afdd2c96d5a1be4 Mon Sep 17 00:00:00 2001 From: Alemiz Date: Mon, 16 Sep 2024 15:37:59 +0200 Subject: [PATCH] Add null check for DynamicID too --- .../codec/v712/serializer/InventoryContentSerializer_v712.java | 2 +- .../codec/v712/serializer/InventorySlotSerializer_v712.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/codec/v712/serializer/InventoryContentSerializer_v712.java b/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/codec/v712/serializer/InventoryContentSerializer_v712.java index bf9f9ce23..3478ed7c0 100644 --- a/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/codec/v712/serializer/InventoryContentSerializer_v712.java +++ b/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/codec/v712/serializer/InventoryContentSerializer_v712.java @@ -14,7 +14,7 @@ public class InventoryContentSerializer_v712 extends InventoryContentSerializer_ @Override public void serialize(ByteBuf buffer, BedrockCodecHelper helper, InventoryContentPacket packet) { super.serialize(buffer, helper, packet); - VarInts.writeUnsignedInt(buffer, packet.getContainerNameData() == null ? 0 : packet.getContainerNameData().getDynamicId()); + VarInts.writeUnsignedInt(buffer, packet.getContainerNameData() == null || packet.getContainerNameData().getDynamicId() == null ? 0 : packet.getContainerNameData().getDynamicId()); } @Override diff --git a/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/codec/v712/serializer/InventorySlotSerializer_v712.java b/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/codec/v712/serializer/InventorySlotSerializer_v712.java index f9d8506e4..af7985e74 100644 --- a/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/codec/v712/serializer/InventorySlotSerializer_v712.java +++ b/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/codec/v712/serializer/InventorySlotSerializer_v712.java @@ -15,7 +15,7 @@ public class InventorySlotSerializer_v712 implements BedrockPacketSerializer