Do not pass failed IncomingPacket to PacketFactorys

This commit is contained in:
Him188 2021-06-08 12:16:26 +08:00
parent 725b502d9e
commit 3e8fc8e1ec

View File

@ -92,6 +92,7 @@ internal class CallPacketFactoryPacketHandler(
) : PacketHandler {
override suspend fun handlePacket(incomingPacket: IncomingPacket) {
if (incomingPacket.exception != null) return // failure
val factory = KnownPacketFactories.findPacketFactory(incomingPacket.commandName) ?: return
factory.cast<PacketFactory<Packet?>>().run {
when (this) {