Showing
1 changed file
with
6 additions
and
4 deletions
@@ -84,10 +84,12 @@ public class TkDeviceServiceImpl extends AbstractBaseService<DeviceMapper, TkDev | @@ -84,10 +84,12 @@ public class TkDeviceServiceImpl extends AbstractBaseService<DeviceMapper, TkDev | ||
84 | //更改了产品,需将原产品的缓存置为无效 | 84 | //更改了产品,需将原产品的缓存置为无效 |
85 | cacheUtils.invalidate(cacheName,deviceDTO.getTenantId()+","+entity.getProfileId()); | 85 | cacheUtils.invalidate(cacheName,deviceDTO.getTenantId()+","+entity.getProfileId()); |
86 | } | 86 | } |
87 | - Optional.ofNullable(db.getDeviceInfo().get(FastIotConstants.DeviceAdditional.SIP)).ifPresent(sip ->{ | ||
88 | - ObjectNode additional = (ObjectNode) deviceDTO.getDeviceInfo(); | ||
89 | - additional.set(FastIotConstants.DeviceAdditional.SIP,sip); | ||
90 | - }); | 87 | + if(null !=db.getDeviceInfo()){ |
88 | + Optional.ofNullable(db.getDeviceInfo().get(FastIotConstants.DeviceAdditional.SIP)).ifPresent(sip ->{ | ||
89 | + ObjectNode additional = (ObjectNode) deviceDTO.getDeviceInfo(); | ||
90 | + additional.set(FastIotConstants.DeviceAdditional.SIP,sip); | ||
91 | + }); | ||
92 | + } | ||
91 | }); | 93 | }); |
92 | TkDeviceEntity device = new TkDeviceEntity(); | 94 | TkDeviceEntity device = new TkDeviceEntity(); |
93 | deviceDTO.copyToEntity( | 95 | deviceDTO.copyToEntity( |