From c413e53a004ea3c8deedd2a769840e7af0d235e6 Mon Sep 17 00:00:00 2001 From: wushaocheng <15876365887@163.com> Date: Thu, 2 Feb 2023 10:58:10 +0800 Subject: [PATCH] =?UTF-8?q?[Modify]=E4=BF=AE=E6=94=B9OldHttpErrorHandleUti?= =?UTF-8?q?l,=E9=98=B2=E6=AD=A2=E7=A9=BA=E6=8C=87=E9=92=88?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../xchat_android_core/utils/OldHttpErrorHandleUtil.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/core/src/main/java/com/yizhuan/xchat_android_core/utils/OldHttpErrorHandleUtil.java b/core/src/main/java/com/yizhuan/xchat_android_core/utils/OldHttpErrorHandleUtil.java index c9c2b565d..8f9c56544 100644 --- a/core/src/main/java/com/yizhuan/xchat_android_core/utils/OldHttpErrorHandleUtil.java +++ b/core/src/main/java/com/yizhuan/xchat_android_core/utils/OldHttpErrorHandleUtil.java @@ -29,11 +29,11 @@ public class OldHttpErrorHandleUtil { return ResUtil.getString(R.string.xchat_android_core_utils_oldhttperrorhandleutil_01); } return result.getMessage(); - } else if (throwable.getMessage().contains("SocketTimeoutException") || throwable.getMessage().contains("ConnectException") || throwable.getMessage().contains("UnknownHostException")) { + } else if (throwable.getMessage() != null && (throwable.getMessage().contains("SocketTimeoutException") || throwable.getMessage().contains("ConnectException") || throwable.getMessage().contains("UnknownHostException"))) { return ResUtil.getString(R.string.xchat_android_core_utils_oldhttperrorhandleutil_02); - } else if (throwable.getMessage().contains("JsonParseException") || throwable.getMessage().contains("JSONException") || throwable.getMessage().contains("ParseException") ) { + } else if (throwable.getMessage() != null && (throwable.getMessage().contains("JsonParseException") || throwable.getMessage().contains("JSONException") || throwable.getMessage().contains("ParseException"))) { return ResUtil.getString(R.string.data_parsing_exception); - } else if (throwable.getMessage().contains("IllegalArgumentException")) { + } else if (throwable.getMessage() != null && throwable.getMessage().contains("IllegalArgumentException")) { return ResUtil.getString(R.string.parameter_error); } else { return throwable.getMessage();