DeviceDataValidator: invalidate name containing 0x00 symbols
This commit is contained in:
parent
7177f8143c
commit
22c9aa3776
@ -64,6 +64,9 @@ public class DeviceDataValidator extends AbstractHasOtaPackageValidator<Device>
|
|||||||
if (StringUtils.isEmpty(device.getName()) || device.getName().trim().length() == 0) {
|
if (StringUtils.isEmpty(device.getName()) || device.getName().trim().length() == 0) {
|
||||||
throw new DataValidationException("Device name should be specified!");
|
throw new DataValidationException("Device name should be specified!");
|
||||||
}
|
}
|
||||||
|
if (StringUtils.contains0x00(device.getName())) {
|
||||||
|
throw new DataValidationException("Device name should not contain 0x00 symbol!");
|
||||||
|
}
|
||||||
if (device.getTenantId() == null) {
|
if (device.getTenantId() == null) {
|
||||||
throw new DataValidationException("Device should be assigned to tenant!");
|
throw new DataValidationException("Device should be assigned to tenant!");
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user