فهرست منبع

修复 水稻测温病导出报错

zhaiyifei 10 ماه پیش
والد
کامیت
a5f23fc805
1فایلهای تغییر یافته به همراه4 افزوده شده و 1 حذف شده
  1. 4 1
      src/main/java/com/yunfeiyun/agmp/iotm/device/bzy/controller/IotDeviceBzyController.java

+ 4 - 1
src/main/java/com/yunfeiyun/agmp/iotm/device/bzy/controller/IotDeviceBzyController.java

@@ -202,8 +202,11 @@ public class IotDeviceBzyController extends BaseController {
         if(iotDevice == null){
         if(iotDevice == null){
             throw new IotBizException(ErrorCode.INVALID_PARAMETER.getCode(),"设备不存在");
             throw new IotBizException(ErrorCode.INVALID_PARAMETER.getCode(),"设备不存在");
         }
         }
+        JSONObject jsonObject = new JSONObject();
         IotDeviceconfig iotDeviceconfig = iIotDeviceconfigService.selectIotDeviceConfigByDevBid(devBid);
         IotDeviceconfig iotDeviceconfig = iIotDeviceconfigService.selectIotDeviceConfigByDevBid(devBid);
-        JSONObject jsonObject = JSONObject.parseObject(iotDeviceconfig.getDevcfgContext());
+        if(iotDeviceconfig != null){
+            jsonObject = JSONObject.parseObject(iotDeviceconfig.getDevcfgContext());
+        }
         return AjaxResult.success(jsonObject);
         return AjaxResult.success(jsonObject);
     }
     }