AI: prevent empty text

This commit is contained in:
M66B 2024-05-23 10:38:16 +02:00
parent 65e214fc47
commit 50f16d93ac
1 changed files with 2 additions and 2 deletions

View File

@ -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);