From 79c2ce9f9cadf7e7e10aca9b53b0e07c8bdd4e1d Mon Sep 17 00:00:00 2001 From: Next Alone <12210746+NextAlone@users.noreply.github.com> Date: Mon, 4 Nov 2024 23:02:22 +0800 Subject: [PATCH] fix: crash in GeneralSetting after DeepLX selected Signed-off-by: Next Alone <12210746+NextAlone@users.noreply.github.com> --- .../nextalone/nnngram/activity/GeneralSettingActivity.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/TMessagesProj/src/main/java/xyz/nextalone/nnngram/activity/GeneralSettingActivity.java b/TMessagesProj/src/main/java/xyz/nextalone/nnngram/activity/GeneralSettingActivity.java index 1b9bc8c92c..66db02b0f1 100644 --- a/TMessagesProj/src/main/java/xyz/nextalone/nnngram/activity/GeneralSettingActivity.java +++ b/TMessagesProj/src/main/java/xyz/nextalone/nnngram/activity/GeneralSettingActivity.java @@ -646,7 +646,11 @@ public void onBindViewHolder(RecyclerView.ViewHolder holder, int position, boole } else if (position == drawerListRow) { textCell.setText(LocaleController.getString("drawerList", R.string.drawerList), false); } else if (position == deepLxApiRow) { - textCell.setTextAndValue(LocaleController.getString(R.string.DeepLxApi), Config.getDeepLxApi().substring(0, 25) + "...", payload, true); + String value = Config.getDeepLxApi(); + if (value.length() > 25) { + value = value.substring(0, 25) + "..."; + } + textCell.setTextAndValue(LocaleController.getString(R.string.DeepLxApi), value, payload, true); } break; }