diff --git a/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/codec/v618/serializer/ResourcePacksInfoSerializer_v618.java b/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/codec/v618/serializer/ResourcePacksInfoSerializer_v618.java
index 9ca065954..388091229 100644
--- a/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/codec/v618/serializer/ResourcePacksInfoSerializer_v618.java
+++ b/bedrock-codec/src/main/java/org/cloudburstmc/protocol/bedrock/codec/v618/serializer/ResourcePacksInfoSerializer_v618.java
@@ -13,6 +13,8 @@
 import java.util.HashMap;
 import java.util.Map;
 
+import static org.cloudburstmc.protocol.common.util.Preconditions.checkArgument;
+
 @RequiredArgsConstructor(access = AccessLevel.PROTECTED)
 public class ResourcePacksInfoSerializer_v618 extends ResourcePacksInfoSerializer_v448 {
     private static final InternalLogger log = InternalLoggerFactory.getInstance(ResourcePacksInfoSerializer_v618.class);
@@ -54,9 +56,7 @@ protected void writeCDNEntries(ByteBuf buffer, ResourcePacksInfoPacket packet, B
 
     protected void readCDNEntries(ByteBuf buffer, ResourcePacksInfoPacket packet, BedrockCodecHelper helper) {
         int size = VarInts.readUnsignedInt(buffer);
-        if (size > helper.getEncodingSettings().maxListSize()) {
-            throw new IllegalArgumentException("CDN entries size exceeds maximum size " + size);
-        }
+        checkArgument(helper.getEncodingSettings().maxListSize() <= 0 || size <= helper.getEncodingSettings().maxListSize(), "CDN entries size is too big: %s", size);
 
         if (size == 0 || packet.getResourcePackInfos().isEmpty()) {
             return;