Fix wrong sanity check condition
This commit is contained in:
parent
8abd17b670
commit
da0f5d544b
@ -34,11 +34,11 @@ inline fun encodePayload(registry: RegistryAccess, block: (RegistryFriendlyByteB
|
|||||||
|
|
||||||
try {
|
try {
|
||||||
block.invoke(buf)
|
block.invoke(buf)
|
||||||
|
buf.readerIndex(0)
|
||||||
|
|
||||||
val bytes = ByteArrayList(buf.readableBytes())
|
val bytes = ByteArray(buf.readableBytes())
|
||||||
check(bytes.size == buf.readableBytes())
|
buf.readBytes(bytes)
|
||||||
buf.readBytes(bytes.elements())
|
return ByteArrayList.wrap(bytes)
|
||||||
return bytes
|
|
||||||
} finally {
|
} finally {
|
||||||
underlying.release()
|
underlying.release()
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user