fix 更新版本可能导致异常崩溃
This commit is contained in:
@@ -19,6 +19,7 @@ object UpdateUtil {
|
|||||||
OkGo.get<String>(Constant.getCheckUpdateUrl())
|
OkGo.get<String>(Constant.getCheckUpdateUrl())
|
||||||
.execute(object : StringCallback() {
|
.execute(object : StringCallback() {
|
||||||
override fun onSuccess(response: Response<String>) {
|
override fun onSuccess(response: Response<String>) {
|
||||||
|
try {
|
||||||
val commonResult =
|
val commonResult =
|
||||||
GsonUtils.fromJson(
|
GsonUtils.fromJson(
|
||||||
response.body(),
|
response.body(),
|
||||||
@@ -48,7 +49,10 @@ object UpdateUtil {
|
|||||||
}
|
}
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
ToastUtils.showLong(R.string.update_failed)
|
} catch (e: Exception) {
|
||||||
|
LogUtils.e(e)
|
||||||
|
onError(response)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun onError(response: Response<String>) {
|
override fun onError(response: Response<String>) {
|
||||||
|
|||||||
Reference in New Issue
Block a user