mirror of
https://github.com/mamoe/mirai.git
synced 2025-03-12 14:00:12 +08:00
Fix expcetion when length=0
This commit is contained in:
parent
5c68fc53e8
commit
b38f82523f
@ -276,6 +276,11 @@ internal class QQAndroidBotNetworkHandler(bot: QQAndroidBot) : BotNetworkHandler
|
|||||||
while (rawInput.remaining >= length) {
|
while (rawInput.remaining >= length) {
|
||||||
parsePacketAsync(rawInput.readPacket(length))
|
parsePacketAsync(rawInput.readPacket(length))
|
||||||
|
|
||||||
|
if (rawInput.remaining == 0L) {
|
||||||
|
cachedPacket.value = null // 表示包长度正好
|
||||||
|
cachedPacketTimeoutJob?.cancel()
|
||||||
|
return
|
||||||
|
}
|
||||||
length = rawInput.readInt() - 4
|
length = rawInput.readInt() - 4
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user