mirror of
https://github.com/mamoe/mirai.git
synced 2025-01-22 13:46:13 +08:00
Do not pass failed IncomingPacket
to PacketFactory
s
This commit is contained in:
parent
725b502d9e
commit
3e8fc8e1ec
@ -92,6 +92,7 @@ internal class CallPacketFactoryPacketHandler(
|
|||||||
) : PacketHandler {
|
) : PacketHandler {
|
||||||
|
|
||||||
override suspend fun handlePacket(incomingPacket: IncomingPacket) {
|
override suspend fun handlePacket(incomingPacket: IncomingPacket) {
|
||||||
|
if (incomingPacket.exception != null) return // failure
|
||||||
val factory = KnownPacketFactories.findPacketFactory(incomingPacket.commandName) ?: return
|
val factory = KnownPacketFactories.findPacketFactory(incomingPacket.commandName) ?: return
|
||||||
factory.cast<PacketFactory<Packet?>>().run {
|
factory.cast<PacketFactory<Packet?>>().run {
|
||||||
when (this) {
|
when (this) {
|
||||||
|
Loading…
Reference in New Issue
Block a user