From 6fa3c687f0a633e0046a4018207bddc7a6ce0319 Mon Sep 17 00:00:00 2001 From: xtaodada Date: Mon, 6 May 2024 21:04:18 +0800 Subject: [PATCH] fix: telegram api translator log error --- .../nekogram/transtale/source/TelegramAPITranslator.kt | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/TMessagesProj/src/main/java/tw/nekomimi/nekogram/transtale/source/TelegramAPITranslator.kt b/TMessagesProj/src/main/java/tw/nekomimi/nekogram/transtale/source/TelegramAPITranslator.kt index de04a3cade..84e79933ec 100644 --- a/TMessagesProj/src/main/java/tw/nekomimi/nekogram/transtale/source/TelegramAPITranslator.kt +++ b/TMessagesProj/src/main/java/tw/nekomimi/nekogram/transtale/source/TelegramAPITranslator.kt @@ -41,7 +41,9 @@ object TelegramAPITranslator : Translator { if (res is TL_messages_translateResult && res.result.isNotEmpty()) { it.resume(res.result[0].text) } else { - FileLog.e(err?.text) + if (err?.text != null && err.text!!.isNotEmpty()) { + FileLog.e(err.text) + } it.resumeWithException(RuntimeException("Failed to translate by Telegram API")) } }