lib/nbt: Make list serielizer return an error when serializing a list with no contained type set

Soda
BodgeMaster 2022-10-08 23:35:21 +02:00
parent b1ba33b39f
commit f0092b78d3
1 changed files with 3 additions and 0 deletions

View File

@ -868,6 +868,9 @@ namespace NBT {
}
ErrorOrVoid List::serializeWithoutHeader(std::vector<uint8_t>* rawData) {
if (this->containedType == TagType::INVALID) {
return ErrorOrVoid(true, ErrorCodes::INVALID_TYPE);
}
rawData->push_back(this->containedType);
// 32 bit signed integer max