From aa69f570d26293e0ece30d64888c7ba22b2ccfd3 Mon Sep 17 00:00:00 2001 From: ryoii Date: Wed, 8 Jul 2020 16:59:51 +0800 Subject: [PATCH] Close #370, ignore messages before group is initialized --- .../protocol/packet/chat/receive/OnlinePush.ReqPush.kt | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/mirai-core-qqandroid/src/commonMain/kotlin/net/mamoe/mirai/qqandroid/network/protocol/packet/chat/receive/OnlinePush.ReqPush.kt b/mirai-core-qqandroid/src/commonMain/kotlin/net/mamoe/mirai/qqandroid/network/protocol/packet/chat/receive/OnlinePush.ReqPush.kt index b84d564e3..161167c40 100644 --- a/mirai-core-qqandroid/src/commonMain/kotlin/net/mamoe/mirai/qqandroid/network/protocol/packet/chat/receive/OnlinePush.ReqPush.kt +++ b/mirai-core-qqandroid/src/commonMain/kotlin/net/mamoe/mirai/qqandroid/network/protocol/packet/chat/receive/OnlinePush.ReqPush.kt @@ -81,7 +81,9 @@ internal object OnlinePushReqPush : IncomingPacketFactory = reqPushMsg.vMsgInfos.deco(bot.client) { msgInfo -> when (msgInfo.shMsgType.toInt()) { 732 -> { - val group = bot.getGroup(readUInt().toLong()) + val group = bot.getGroupOrNull(readUInt().toLong()) + ?: return@deco emptySequence() // group has not been initialized + GroupImpl.checkIsInstance(group) val internalType = readByte().toInt()