From 50f16d93ac98978537516b522c38c7b76c2ba926 Mon Sep 17 00:00:00 2001 From: M66B Date: Thu, 23 May 2024 10:38:16 +0200 Subject: [PATCH] AI: prevent empty text --- app/src/main/java/eu/faircode/email/AI.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/eu/faircode/email/AI.java b/app/src/main/java/eu/faircode/email/AI.java index dffabda2c8..d383245e91 100644 --- a/app/src/main/java/eu/faircode/email/AI.java +++ b/app/src/main/java/eu/faircode/email/AI.java @@ -43,8 +43,8 @@ public class AI { } static String completeChat(Context context, long id, CharSequence body) throws JSONException, IOException { - if (body == null || body.length() == 0) - return null; + if (body == null || TextUtils.isEmpty(body.toString().trim())) + body = "?"; if (OpenAI.isAvailable(context)) { SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(context);