Added proper hanling of null values for provision device key

This commit is contained in:
Volodymyr Babak 2021-08-02 14:55:43 +03:00
parent 414087c090
commit d95c2b88b0

View File

@ -61,7 +61,9 @@ public class DeviceProfileMsgConstructor {
if (deviceProfile.getProvisionType() != null) { if (deviceProfile.getProvisionType() != null) {
builder.setProvisionType(getStringValue(deviceProfile.getProvisionType().name())); builder.setProvisionType(getStringValue(deviceProfile.getProvisionType().name()));
} }
if (deviceProfile.getProvisionDeviceKey() != null) {
builder.setProvisionDeviceKey(getStringValue(deviceProfile.getProvisionDeviceKey())); builder.setProvisionDeviceKey(getStringValue(deviceProfile.getProvisionDeviceKey()));
}
if (deviceProfile.getImage() != null) { if (deviceProfile.getImage() != null) {
builder.setImage(getBytesValue(ByteString.copyFrom(deviceProfile.getImage().getBytes(StandardCharsets.UTF_8)))); builder.setImage(getBytesValue(ByteString.copyFrom(deviceProfile.getImage().getBytes(StandardCharsets.UTF_8))));
} }