Browse Source

Fix for NPE

pull/11341/head
imbeacon 2 years ago
parent
commit
6b99fb917a
  1. 2
      dao/src/main/java/org/thingsboard/server/dao/device/DeviceServiceImpl.java

2
dao/src/main/java/org/thingsboard/server/dao/device/DeviceServiceImpl.java

@ -557,7 +557,7 @@ public class DeviceServiceImpl extends CachedVersionedEntityService<DeviceCacheK
device.setType(profile.getName());
device.setTenantId(profile.getTenantId());
ObjectNode additionalInfoNode = JacksonUtil.newObjectNode();
if (provisionRequest.getGateway()) {
if (provisionRequest.getGateway() != null && provisionRequest.getGateway()) {
additionalInfoNode.put(DataConstants.GATEWAY_PARAMETER, true);
}
device.setAdditionalInfo(additionalInfoNode);

Loading…
Cancel
Save