diff --git a/src/lib/nbt.cpp b/src/lib/nbt.cpp index 1684093..455d185 100644 --- a/src/lib/nbt.cpp +++ b/src/lib/nbt.cpp @@ -868,6 +868,9 @@ namespace NBT { } ErrorOrVoid List::serializeWithoutHeader(std::vector* rawData) { + if (this->containedType == TagType::INVALID) { + return ErrorOrVoid(true, ErrorCodes::INVALID_TYPE); + } rawData->push_back(this->containedType); // 32 bit signed integer max