mirror of
https://github.com/ViaVersion/ViaVersion.git
synced 2025-02-02 12:51:22 +01:00
Fix inverted array read check
This commit is contained in:
parent
1b207251e8
commit
915258169e
@ -18,7 +18,7 @@ public class ByteArrayType extends Type<byte[]> {
|
|||||||
@Override
|
@Override
|
||||||
public byte[] read(ByteBuf buffer) throws Exception {
|
public byte[] read(ByteBuf buffer) throws Exception {
|
||||||
int length = Type.VAR_INT.read(buffer);
|
int length = Type.VAR_INT.read(buffer);
|
||||||
Preconditions.checkArgument(!buffer.isReadable(length), "Length is fewer than readable bytes");
|
Preconditions.checkArgument(buffer.isReadable(length), "Length is fewer than readable bytes");
|
||||||
byte[] array = new byte[length];
|
byte[] array = new byte[length];
|
||||||
buffer.readBytes(array);
|
buffer.readBytes(array);
|
||||||
return array;
|
return array;
|
||||||
|
Loading…
Reference in New Issue
Block a user