Asset validator: validation that name does not contain 0x00 symbols

This commit is contained in:
Sergey Matvienko 2023-09-01 15:42:27 +02:00
parent c14719a4f8
commit 9e7a6500d2

View File

@ -67,6 +67,9 @@ public class AssetDataValidator extends DataValidator<Asset> {
if (StringUtils.isEmpty(asset.getName())) { if (StringUtils.isEmpty(asset.getName())) {
throw new DataValidationException("Asset name should be specified!"); throw new DataValidationException("Asset name should be specified!");
} }
if (StringUtils.contains0x00(asset.getName())) {
throw new DataValidationException("Asset name should not contain 0x00 symbol!");
}
if (asset.getTenantId() == null) { if (asset.getTenantId() == null) {
throw new DataValidationException("Asset should be assigned to tenant!"); throw new DataValidationException("Asset should be assigned to tenant!");
} else { } else {