summaryrefslogtreecommitdiffstats
path: root/openecomp-be/backend/openecomp-sdc-vendor-license-manager
diff options
context:
space:
mode:
Diffstat (limited to 'openecomp-be/backend/openecomp-sdc-vendor-license-manager')
-rw-r--r--openecomp-be/backend/openecomp-sdc-vendor-license-manager/src/main/java/org/openecomp/sdc/vendorlicense/impl/VendorLicenseManagerImpl.java9
1 files changed, 8 insertions, 1 deletions
diff --git a/openecomp-be/backend/openecomp-sdc-vendor-license-manager/src/main/java/org/openecomp/sdc/vendorlicense/impl/VendorLicenseManagerImpl.java b/openecomp-be/backend/openecomp-sdc-vendor-license-manager/src/main/java/org/openecomp/sdc/vendorlicense/impl/VendorLicenseManagerImpl.java
index 5553b784f6..8135efa89a 100644
--- a/openecomp-be/backend/openecomp-sdc-vendor-license-manager/src/main/java/org/openecomp/sdc/vendorlicense/impl/VendorLicenseManagerImpl.java
+++ b/openecomp-be/backend/openecomp-sdc-vendor-license-manager/src/main/java/org/openecomp/sdc/vendorlicense/impl/VendorLicenseManagerImpl.java
@@ -94,7 +94,14 @@ public class VendorLicenseManagerImpl implements VendorLicenseManager {
@Override
public void updateVendorLicenseModel(VendorLicenseModelEntity vendorLicenseModelEntity) {
- String existingVendorName = vendorLicenseModelDao.get(vendorLicenseModelEntity).getVendorName();
+ VendorLicenseModelEntity retrieved = vendorLicenseModelDao.get(vendorLicenseModelEntity);
+ if (retrieved == null){
+ throw new CoreException((new ErrorCode.ErrorCodeBuilder()
+ .withMessage(String.format("Vlm with id %s and version %s does not exist.",
+ vendorLicenseModelEntity.getId(), vendorLicenseModelEntity.getVersion().getId()))).build());
+ }
+
+ String existingVendorName = retrieved.getVendorName();
updateUniqueName(VendorLicenseConstants.UniqueValues.VENDOR_NAME, existingVendorName,
vendorLicenseModelEntity.getVendorName());