AI: prevent empty text

pull/215/head
M66B 7 months ago
parent 65e214fc47
commit 50f16d93ac

@ -43,8 +43,8 @@ public class AI {
} }
static String completeChat(Context context, long id, CharSequence body) throws JSONException, IOException { static String completeChat(Context context, long id, CharSequence body) throws JSONException, IOException {
if (body == null || body.length() == 0) if (body == null || TextUtils.isEmpty(body.toString().trim()))
return null; body = "?";
if (OpenAI.isAvailable(context)) { if (OpenAI.isAvailable(context)) {
SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(context); SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(context);

Loading…
Cancel
Save