Skip to content

Commit c58b5f4

Browse files
author
fxu
committed
refactor(util): 调整版本检查逻辑顺序
1 parent 2a21c46 commit c58b5f4

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

xcore/src/main/java/com/xwintop/xcore/util/VersionChecker.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,9 +42,9 @@ public static void checkerVersion(String checkUrl, String downloadUrl, String ve
4242
}
4343

4444
public static void hasNewVersion(String url, String localVersion, BiConsumer<String, String> runnable) {
45-
String json = HttpUtil.get(url);
46-
JSONObject jsonObject = JSON.parseObject(json);
4745
try {
46+
String json = HttpUtil.get(url);
47+
JSONObject jsonObject = JSON.parseObject(json);
4848
final String latestVersion = jsonObject.getString("tag_name");
4949
final String features = jsonObject.getString("body");
5050
compareAndRun(latestVersion, features, localVersion, runnable);

0 commit comments

Comments
 (0)