[ox/mc] Fix read to resize Vectors before writing to them

This commit is contained in:
2019-10-25 21:48:43 -05:00
parent 37009a7923
commit 4ca4c31539
4 changed files with 22 additions and 18 deletions

View File

@@ -86,7 +86,8 @@ static ox::Error parseField(const DescriptorField &field, Reader *rdr, DataWalke
walker->pushNamePath(field.fieldName);
if (field.subscriptLevels) {
// add array handling
const auto arrayLen = rdr->arrayLength(true);
const auto [arrayLen, err] = rdr->arrayLength(true);
oxReturnError(err);
auto child = rdr->child();
child.setTypeInfo(field.fieldName.c_str(), arrayLen);
DescriptorField f(field); // create mutable copy