Quellcode durchsuchen

补充告警记录查询不到的异常处理

liuyaowen vor 9 Monaten
Ursprung
Commit
77cc84e96a

+ 3 - 0
src/main/java/com/yunfeiyun/agmp/iotm/web/service/impl/IotWarnlogServiceImpl.java

@@ -61,6 +61,9 @@ public class IotWarnlogServiceImpl implements IIotWarnlogService {
     @Override
     @Override
     public IotWarnlogResVo selectIotWarnlogResVoByWlBid(String wlBid, String tid){
     public IotWarnlogResVo selectIotWarnlogResVoByWlBid(String wlBid, String tid){
         IotWarnlog iotWarnlog = iotWarnlogMapper.selectIotWarnlogById(wlBid, tid);
         IotWarnlog iotWarnlog = iotWarnlogMapper.selectIotWarnlogById(wlBid, tid);
+        if(null == iotWarnlog){
+            return null;
+        }
         IotWarnlogResVo iotWarnlogResVo = new IotWarnlogResVo();
         IotWarnlogResVo iotWarnlogResVo = new IotWarnlogResVo();
         BeanUtils.copyProperties(iotWarnlog,iotWarnlogResVo);
         BeanUtils.copyProperties(iotWarnlog,iotWarnlogResVo);
         IotDevice iotDevice = iotDeviceMapper.selectIotDeviceByDevBid(iotWarnlogResVo.getDevBid());
         IotDevice iotDevice = iotDeviceMapper.selectIotDeviceByDevBid(iotWarnlogResVo.getDevBid());