From 28a0efc6ec16f3f82eb8e16e87269300d6744fd4 Mon Sep 17 00:00:00 2001 From: admin <weikou2014> Date: 星期三, 25 九月 2019 19:18:17 +0800 Subject: [PATCH] 金币版本拦截与频率拦截bug修改 --- utils/src/main/java/org/yeshi/utils/JsonUtil.java | 6 +++++- 1 files changed, 5 insertions(+), 1 deletions(-) diff --git a/utils/src/main/java/org/yeshi/utils/JsonUtil.java b/utils/src/main/java/org/yeshi/utils/JsonUtil.java index 2d229c5..ff23e1f 100644 --- a/utils/src/main/java/org/yeshi/utils/JsonUtil.java +++ b/utils/src/main/java/org/yeshi/utils/JsonUtil.java @@ -271,7 +271,11 @@ List<T> list = new ArrayList<>(); JSONArray array = JSONArray.fromObject(jsonData); for (int i = 0; i < array.size(); i++) { - list.add(baseGson.fromJson(array.optJSONObject(i).toString(), beanType)); + try { + list.add(baseGson.fromJson(array.optJSONObject(i).toString(), beanType)); + } catch (Exception e) { + list.add(baseGson.fromJson(array.optString(i), beanType)); + } } return list; } -- Gitblit v1.8.0