Commit 084d1eed37db84516e9b192ebd9c347fd3de5506

Authored by Vladyslav_Prykhodko
1 parent c40faa87

Fixed ota-package validation

@@ -434,7 +434,7 @@ public class DeviceProfileServiceImpl extends AbstractEntityService implements D @@ -434,7 +434,7 @@ public class DeviceProfileServiceImpl extends AbstractEntityService implements D
434 if (!firmware.getType().equals(OtaPackageType.FIRMWARE)) { 434 if (!firmware.getType().equals(OtaPackageType.FIRMWARE)) {
435 throw new DataValidationException("Can't assign firmware with type: " + firmware.getType()); 435 throw new DataValidationException("Can't assign firmware with type: " + firmware.getType());
436 } 436 }
437 - if (firmware.getData() == null) { 437 + if (firmware.getData() == null && !firmware.hasUrl()) {
438 throw new DataValidationException("Can't assign firmware with empty data!"); 438 throw new DataValidationException("Can't assign firmware with empty data!");
439 } 439 }
440 if (!firmware.getDeviceProfileId().equals(deviceProfile.getId())) { 440 if (!firmware.getDeviceProfileId().equals(deviceProfile.getId())) {
@@ -716,7 +716,7 @@ public class DeviceServiceImpl extends AbstractEntityService implements DeviceSe @@ -716,7 +716,7 @@ public class DeviceServiceImpl extends AbstractEntityService implements DeviceSe
716 if (!firmware.getType().equals(OtaPackageType.FIRMWARE)) { 716 if (!firmware.getType().equals(OtaPackageType.FIRMWARE)) {
717 throw new DataValidationException("Can't assign firmware with type: " + firmware.getType()); 717 throw new DataValidationException("Can't assign firmware with type: " + firmware.getType());
718 } 718 }
719 - if (firmware.getData() == null) { 719 + if (firmware.getData() == null && !firmware.hasUrl()) {
720 throw new DataValidationException("Can't assign firmware with empty data!"); 720 throw new DataValidationException("Can't assign firmware with empty data!");
721 } 721 }
722 if (!firmware.getDeviceProfileId().equals(device.getDeviceProfileId())) { 722 if (!firmware.getDeviceProfileId().equals(device.getDeviceProfileId())) {