diff --git a/dao/src/main/java/org/thingsboard/server/dao/device/DeviceProfileServiceImpl.java b/dao/src/main/java/org/thingsboard/server/dao/device/DeviceProfileServiceImpl.java index 696e84895c..7ec1e662af 100644 --- a/dao/src/main/java/org/thingsboard/server/dao/device/DeviceProfileServiceImpl.java +++ b/dao/src/main/java/org/thingsboard/server/dao/device/DeviceProfileServiceImpl.java @@ -450,7 +450,7 @@ public class DeviceProfileServiceImpl extends AbstractEntityService implements D if (!software.getType().equals(OtaPackageType.SOFTWARE)) { throw new DataValidationException("Can't assign software with type: " + software.getType()); } - if (software.getData() == null) { + if (software.getData() == null && !software.hasUrl()) { throw new DataValidationException("Can't assign software with empty data!"); } if (!software.getDeviceProfileId().equals(deviceProfile.getId())) { diff --git a/dao/src/main/java/org/thingsboard/server/dao/device/DeviceServiceImpl.java b/dao/src/main/java/org/thingsboard/server/dao/device/DeviceServiceImpl.java index 9d0e2a00d2..f1470ff5ad 100644 --- a/dao/src/main/java/org/thingsboard/server/dao/device/DeviceServiceImpl.java +++ b/dao/src/main/java/org/thingsboard/server/dao/device/DeviceServiceImpl.java @@ -732,7 +732,7 @@ public class DeviceServiceImpl extends AbstractEntityService implements DeviceSe if (!software.getType().equals(OtaPackageType.SOFTWARE)) { throw new DataValidationException("Can't assign software with type: " + software.getType()); } - if (software.getData() == null) { + if (software.getData() == null && !software.hasUrl()) { throw new DataValidationException("Can't assign software with empty data!"); } if (!software.getDeviceProfileId().equals(device.getDeviceProfileId())) { diff --git a/ui-ngx/src/app/modules/home/pages/ota-update/ota-update-table-config.resolve.ts b/ui-ngx/src/app/modules/home/pages/ota-update/ota-update-table-config.resolve.ts index dcff8b7964..0f542bec8a 100644 --- a/ui-ngx/src/app/modules/home/pages/ota-update/ota-update-table-config.resolve.ts +++ b/ui-ngx/src/app/modules/home/pages/ota-update/ota-update-table-config.resolve.ts @@ -65,7 +65,7 @@ export class OtaUpdateTableConfigResolve implements Resolve('url', 'ota-update.direct-url', '20%', entity => { - return entity.url && entity.url.length > 20 ? `${entity.url.slice(0, 20)}…` : ''; + return entity.url ? (entity.url.length > 20 ? `${entity.url.slice(0, 20)}…` : entity.url) : ''; }, () => ({}), true, () => ({}), () => undefined, false, { name: this.translate.instant('ota-update.copy-direct-url'),