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