Browse Source

处理iot空指针异常

lixing 2 years ago
parent
commit
6a78283351

+ 3 - 3
src/main/java/com/persagy/apm/report/dependencies/iotdataanalysis/service/impl/IDataAnalysisWebServiceImpl.java

@@ -30,8 +30,8 @@ public class IDataAnalysisWebServiceImpl implements IDataAnalysisWebService {
         try {
             JSONObject paramObject = new JSONObject();
             paramObject.put("userId", DataConstants.USER_ID);
-//                        paramObject.put("groupCode", "BL");
-//                        projectId = "Pj1101080259";
+            //                        paramObject.put("groupCode", "BL");
+            //                        projectId = "Pj1101080259";
             paramObject.put("groupCode", groupCode);
             paramObject.put("projectIdList", Lists.newArrayList(projectId));
             // 加入分页条件,接口要求分页条件必传
@@ -50,7 +50,7 @@ public class IDataAnalysisWebServiceImpl implements IDataAnalysisWebService {
                     Map data = content.get(0);
                     if (null != data) {
                         Double targetValue = DataUtils.parseDouble(data.get(targetCode));
-                        if (Math.abs(targetValue) > 100) {
+                        if (targetValue != null && Math.abs(targetValue) > 100) {
                             targetValue = null;
                         }
                         return targetValue;