lib/nbt: Return the correct error code from soem functions for i32 arrays.
parent
77dd79398f
commit
996154fbbc
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue