lib/nbt: Fix a bug caused by having two return statements swapped

Soda
BodgeMaster 2022-10-08 12:54:05 +02:00
parent b53999a548
commit 833c09e2da
1 changed files with 2 additions and 2 deletions

View File

@ -776,10 +776,10 @@ namespace NBT {
ErrorOr<int8_t> Int8Array::getValue(uint64_t position) {
if (this->data.size() <= position) {
return ErrorOr<int8_t>(this->data.at(position));
return ErrorOr<int8_t>(true, ErrorCodes::OUT_OF_RANGE);
}
return ErrorOr<int8_t>(true, ErrorCodes::OUT_OF_RANGE);
return ErrorOr<int8_t>(this->data.at(position));
}
void Int8Array::setData(std::vector<int8_t> newData) {