Browse Source

DeviceDataValidator: invalidate name containing 0x00 symbols

pull/9163/head
Sergey Matvienko 3 years ago
parent
commit
22c9aa3776
  1. 3
      dao/src/main/java/org/thingsboard/server/dao/service/validator/DeviceDataValidator.java

3
dao/src/main/java/org/thingsboard/server/dao/service/validator/DeviceDataValidator.java

@ -64,6 +64,9 @@ public class DeviceDataValidator extends AbstractHasOtaPackageValidator<Device>
if (StringUtils.isEmpty(device.getName()) || device.getName().trim().length() == 0) {
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) {
throw new DataValidationException("Device should be assigned to tenant!");
} else {

Loading…
Cancel
Save