lib/nbt: Return the correct error code from soem functions for i32 arrays.

Soda
BodgeMaster 2022-10-14 22:31:24 +02:00
parent 77dd79398f
commit 996154fbbc
1 changed files with 2 additions and 2 deletions

View File

@ -1066,7 +1066,7 @@ namespace NBT {
ErrorOr<int32_t> Int32Array::getValue(uint64_t position) {
if (position >= this->data.size()) {
return ErrorOr<int32_t>(true, ErrorCodes::OVERRUN);
return ErrorOr<int32_t>(true, ErrorCodes::OUT_OF_RANGE);
}
return ErrorOr<int32_t>(this->data.at(position));
@ -1078,7 +1078,7 @@ namespace NBT {
ErrorOrVoid Int32Array::setValue(uint64_t position, int32_t value) {
if (position >= this->data.size()) {
return ErrorOrVoid(true, ErrorCodes::OVERRUN);
return ErrorOrVoid(true, ErrorCodes::OUT_OF_RANGE);
}
this->data[position] = value;