diff options
Diffstat (limited to 'openecomp-be/backend/openecomp-sdc-action-manager/src/main/java/org')
-rw-r--r-- | openecomp-be/backend/openecomp-sdc-action-manager/src/main/java/org/openecomp/sdc/action/impl/ActionManagerImpl.java | 22 |
1 files changed, 12 insertions, 10 deletions
diff --git a/openecomp-be/backend/openecomp-sdc-action-manager/src/main/java/org/openecomp/sdc/action/impl/ActionManagerImpl.java b/openecomp-be/backend/openecomp-sdc-action-manager/src/main/java/org/openecomp/sdc/action/impl/ActionManagerImpl.java index 36493e2b14..f9b6bfe8a9 100644 --- a/openecomp-be/backend/openecomp-sdc-action-manager/src/main/java/org/openecomp/sdc/action/impl/ActionManagerImpl.java +++ b/openecomp-be/backend/openecomp-sdc-action-manager/src/main/java/org/openecomp/sdc/action/impl/ActionManagerImpl.java @@ -694,11 +694,13 @@ public class ActionManagerImpl implements ActionManager { String artifactName = artifactMetadata.getArtifactName(); String generatedArtifactUuId = generateActionArtifactUuId(action, artifactName); if (generatedArtifactUuId.equals(artifactUuId)) { - ActionArtifactEntity artifactDeleteEntity = - new ActionArtifactEntity(artifact.getArtifactUuId(), - getEffectiveVersion(action.getVersion())); - actionLogPreProcessor(ActionSubOperation.DELETE_ACTION_ARTIFACT, TARGET_ENTITY_DB); - actionArtifactDao.delete(artifactDeleteEntity); + if (artifact != null) { + ActionArtifactEntity artifactDeleteEntity = + new ActionArtifactEntity(artifact.getArtifactUuId(), + getEffectiveVersion(action.getVersion())); + actionLogPreProcessor(ActionSubOperation.DELETE_ACTION_ARTIFACT, TARGET_ENTITY_DB); + actionArtifactDao.delete(artifactDeleteEntity); + } actionLogPostProcessor(StatusCode.COMPLETE, null, "", false); log.metrics(""); } @@ -1041,11 +1043,11 @@ public class ActionManagerImpl implements ActionManager { action.setActionUuId(existingAction.getActionUuId()); } catch (IllegalArgumentException iae) { String message = iae.getMessage(); - switch (message) { - case VERSION_STRING_VIOLATION_MSG: - throw new ActionException(ACTION_UPDATE_NOT_ALLOWED_CODE, message); - default: - throw iae; + if(message == VERSION_STRING_VIOLATION_MSG) { + throw new ActionException(ACTION_UPDATE_NOT_ALLOWED_CODE, message); + } + else { + throw iae; } } } |