Browse Source

Close #370, ignore messages before group is initialized

ryoii 5 years ago
parent
commit
aa69f570d2

+ 3 - 1
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<OnlinePushReqPush.ReqP
         val packets: Sequence<Packet> = 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()