Parcourir la source

修复 数据转换异常

miaolijing il y a 3 ans
Parent
commit
05be754f5b

+ 3 - 0
src/main/java/com/persagy/apm/diagnose/utils/AlarmResultUtil.java

@@ -22,6 +22,9 @@ public class AlarmResultUtil {
         }
 //        JSONArray records = (JSONArray) content.getOrDefault("records", new JSONArray());
         JSONArray records = content.getJSONArray("records");
+        if (records == null || records.isEmpty()) {
+            return new ArrayList<T>();
+        }
         return records.toJavaList(clazz);
     }
 }