aboutsummaryrefslogtreecommitdiffstats
path: root/catalog-be/src/main/java/org
diff options
context:
space:
mode:
Diffstat (limited to 'catalog-be/src/main/java/org')
-rw-r--r--catalog-be/src/main/java/org/openecomp/sdc/be/components/csar/CsarBusinessLogic.java6
1 files changed, 5 insertions, 1 deletions
diff --git a/catalog-be/src/main/java/org/openecomp/sdc/be/components/csar/CsarBusinessLogic.java b/catalog-be/src/main/java/org/openecomp/sdc/be/components/csar/CsarBusinessLogic.java
index b8a5d67d4a..a85b5542a0 100644
--- a/catalog-be/src/main/java/org/openecomp/sdc/be/components/csar/CsarBusinessLogic.java
+++ b/catalog-be/src/main/java/org/openecomp/sdc/be/components/csar/CsarBusinessLogic.java
@@ -223,7 +223,11 @@ public class CsarBusinessLogic extends BaseBusinessLogic {
private VendorSoftwareProduct getCsar(final Resource resource, final User user) {
final Optional<VendorSoftwareProduct> vendorSoftwareProductOpt;
try {
- vendorSoftwareProductOpt = csarOperation.findVsp(resource.getCsarUUID(), resource.getCsarVersionId(), user);
+ if (resource.getCsarVersionId() == null) {
+ vendorSoftwareProductOpt = csarOperation.findLatestVsp(resource.getCsarUUID(), user);
+ } else {
+ vendorSoftwareProductOpt = csarOperation.findVsp(resource.getCsarUUID(), resource.getCsarVersionId(), user);
+ }
} catch (final Exception exception) {
log.error(EcompLoggerErrorCode.BUSINESS_PROCESS_ERROR, CsarBusinessLogic.class.getName(), exception.getMessage());
auditGetCsarError(resource, user, resource.getCsarUUID(), StorageOperationStatus.GENERAL_ERROR);