diff --git a/aiocraft/mc/types.py b/aiocraft/mc/types.py index a31a0fa..d33207b 100644 --- a/aiocraft/mc/types.py +++ b/aiocraft/mc/types.py @@ -225,7 +225,8 @@ class TrailingByteArray(Type): @classmethod def write(cls, data:bytes, buffer:io.BytesIO): - buffer.write(data) + if data: + buffer.write(data) @classmethod def read(cls, buffer:io.BytesIO) -> bytes: