fix a sonar NullPointerException issue in ABL 14/70914/2
authorTal Gitelman <tg851x@intl.att.com>
Mon, 22 Oct 2018 07:25:50 +0000 (10:25 +0300)
committerMichael Lando <michael.lando@intl.att.com>
Tue, 23 Oct 2018 13:53:55 +0000 (13:53 +0000)
Change-Id: I3ee02af56d3073f1e68cefd2a6503cb804af3ffb
Issue-ID: SDC-1831
Signed-off-by: Tal Gitelman <tg851x@intl.att.com>
catalog-be/src/main/java/org/openecomp/sdc/be/components/impl/ArtifactsBusinessLogic.java

index 65260c1..62f62f1 100644 (file)
@@ -4803,17 +4803,11 @@ public class ArtifactsBusinessLogic extends BaseBusinessLogic {
                 log.debug(FAILED_UPLOAD_ARTIFACT_TO_COMPONENT, componentType, componentUuid, actionResult
                         .right()
                         .value());
-                errorWrapper.setInnerElement(actionResult.right().value());
+                return Either.right(actionResult.right().value());
             }
+            return Either.left(actionResult.left().value().left().value());
         }
-        if (errorWrapper.isEmpty()) {
-            uploadArtifact = actionResult.left().value().left().value();
-            uploadArtifactResult = Either.left(uploadArtifact);
-        }
-        else {
-            uploadArtifactResult = Either.right(errorWrapper.getInnerElement());
-        }
-        return uploadArtifactResult;
+        return Either.right(errorWrapper.getInnerElement());
     }
     /**
      * upload an artifact to a resource instance by UUID