Merge "Sequence throws NPE if task outcome is null"
authorLiam Fallon <liam.fallon@est.tech>
Sun, 1 Mar 2020 14:38:22 +0000 (14:38 +0000)
committerGerrit Code Review <gerrit@onap.org>
Sun, 1 Mar 2020 14:38:22 +0000 (14:38 +0000)
models-interactions/model-actors/actorServiceProvider/src/main/java/org/onap/policy/controlloop/actorserviceprovider/impl/OperationPartial.java
models-interactions/model-actors/actorServiceProvider/src/test/java/org/onap/policy/controlloop/actorserviceprovider/impl/OperationPartialTest.java

index 24c7ec8..0436044 100644 (file)
@@ -166,7 +166,7 @@ public abstract class OperationPartial implements Operation {
 
         return outcome -> {
 
-            if (outcome != null && isSuccess(outcome)) {
+            if (isSuccess(outcome)) {
                 logger.info("{}: preprocessor succeeded for {}", getFullName(), params.getRequestId());
                 return CompletableFuture.completedFuture(outcome);
             }
@@ -344,7 +344,7 @@ public abstract class OperationPartial implements Operation {
      * @return {@code true} if the outcome was successful
      */
     protected boolean isSuccess(OperationOutcome outcome) {
-        return (outcome.getResult() == PolicyResult.SUCCESS);
+        return (outcome != null && outcome.getResult() == PolicyResult.SUCCESS);
     }
 
     /**