Ver Fonte

fix bug: 经纬手表切换模式空指针

vinson há 5 anos atrás
pai
commit
e824af1421

+ 3 - 0
src/main/java/com/tidecloud/dataacceptance/service/impl/WatchJWServerHandler.java

@@ -409,6 +409,9 @@ public class WatchJWServerHandler extends HexBinaryAcceptanceHandlerAdapter {
             return;
         }
         SwitchWorkModel swm = switchMap.get(deviceId);
+        if (swm == null) {
+            return;
+        }
         logger.warn("心跳检测是否更改终端模式:" + (nowTime - swm.getActiveTime() + ";" + (nowTime - swm.getSwitchTime())));
         if (nowTime - swm.getActiveTime() > INTERVAL_TIME && nowTime - swm.getSwitchTime() > INTERVAL_TIME) {
             Integer workType = (URGENCY == swm.getWorkType()) ? OTHER : URGENCY;