diff options
Diffstat (limited to 'catalog-be')
-rw-r--r-- | catalog-be/src/main/java/org/openecomp/sdc/be/components/impl/ArtifactsBusinessLogic.java | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/catalog-be/src/main/java/org/openecomp/sdc/be/components/impl/ArtifactsBusinessLogic.java b/catalog-be/src/main/java/org/openecomp/sdc/be/components/impl/ArtifactsBusinessLogic.java index 1db7d447f6..a91497356b 100644 --- a/catalog-be/src/main/java/org/openecomp/sdc/be/components/impl/ArtifactsBusinessLogic.java +++ b/catalog-be/src/main/java/org/openecomp/sdc/be/components/impl/ArtifactsBusinessLogic.java @@ -1142,7 +1142,11 @@ public class ArtifactsBusinessLogic extends BaseBusinessLogic { if (isDeploymentArtifact(artifactInfo)) { if (componentType != ComponentTypeEnum.RESOURCE_INSTANCE) { final String artifactName = artifactInfo.getArtifactName(); - if (operation.isCreateOrLink() || !artifactName.equalsIgnoreCase(existingArtifactInfo.getArtifactName())) { + final String existingArtifactName = + (existingArtifactInfo == null) ? null : existingArtifactInfo.getArtifactName(); + + if (operation.isCreateOrLink() + || ((artifactName != null) && !artifactName.equalsIgnoreCase(existingArtifactName))) { validateSingleDeploymentArtifactName(artifactName, parentComponent); } } @@ -3833,8 +3837,12 @@ public class ArtifactsBusinessLogic extends BaseBusinessLogic { public byte[] downloadResourceInstanceArtifactByUUIDs(ComponentTypeEnum componentType, String componentUuid, String resourceInstanceName, String artifactUUID) { ComponentInstance resourceInstance = getRelatedComponentInstance(componentType, componentUuid, resourceInstanceName); - return downloadArtifact(resourceInstance == null ? null : resourceInstance.getDeploymentArtifacts(), - artifactUUID, resourceInstance.getName()); + + if (resourceInstance != null) { + return downloadArtifact(resourceInstance.getDeploymentArtifacts(), artifactUUID, resourceInstance.getName()); + } else { + return downloadArtifact(null, artifactUUID, null); + } } /** |