From e30f97dc2e7b5c3865f85c59c40da0bfe050681a Mon Sep 17 00:00:00 2001 From: sandtechnology Date: Thu, 17 Dec 2020 13:07:08 +0800 Subject: [PATCH] Add missed channel check --- .../src/commonMain/kotlin/network/QQAndroidBotNetworkHandler.kt | 1 + 1 file changed, 1 insertion(+) diff --git a/mirai-core/src/commonMain/kotlin/network/QQAndroidBotNetworkHandler.kt b/mirai-core/src/commonMain/kotlin/network/QQAndroidBotNetworkHandler.kt index 0d91a9164..e51784c9b 100644 --- a/mirai-core/src/commonMain/kotlin/network/QQAndroidBotNetworkHandler.kt +++ b/mirai-core/src/commonMain/kotlin/network/QQAndroidBotNetworkHandler.kt @@ -615,6 +615,7 @@ internal class QQAndroidBotNetworkHandler(coroutineContext: CoroutineContext, bo suspend fun OutgoingPacket.sendWithoutExpect() { check(bot.isActive) { "bot is dead therefore can't send ${this.commandName}" } check(this@QQAndroidBotNetworkHandler.isActive) { "network is dead therefore can't send any packet" } + check(channel.isOpen) { "network channel is closed" } logger.verbose { "Send: ${this.commandName}" } channel.send(delegate) }