diff --git a/mirai-core/src/commonMain/kotlin/network/highway/ChunkedFlowSession.kt b/mirai-core/src/commonMain/kotlin/network/highway/ChunkedFlowSession.kt index a35239413..55c487342 100644 --- a/mirai-core/src/commonMain/kotlin/network/highway/ChunkedFlowSession.kt +++ b/mirai-core/src/commonMain/kotlin/network/highway/ChunkedFlowSession.kt @@ -36,7 +36,7 @@ internal class ChunkedFlowSession( withUse { while (true) { val size = runBIO { input.readAvailable(buffer) } - if (size == -1) return + if (size <= 0) return block(mapper(buffer, size, offset.getAndAdd(size.toLongUnsigned()))) callback?.onProgression(offset.value) }