diff --git a/TelegramBotAPI/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/bot/Ktor/KtorRequestsExecutor.kt b/TelegramBotAPI/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/bot/Ktor/KtorRequestsExecutor.kt index 379db907df..28bfff56d4 100644 --- a/TelegramBotAPI/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/bot/Ktor/KtorRequestsExecutor.kt +++ b/TelegramBotAPI/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/bot/Ktor/KtorRequestsExecutor.kt @@ -44,7 +44,7 @@ class KtorRequestsExecutor( return handleSafely( { e -> throw if (e is ClientRequestException) { - val content = e.response.readText() + val content = e.response ?.readText() ?: throw e val responseObject = jsonFormatter.decodeFromString(Response.serializer(), content) newRequestException( responseObject,