From af8e36eb7f43803bd9cf40e9b46a0c0c8f47c781 Mon Sep 17 00:00:00 2001 From: shrek2000 Date: Sun, 10 Feb 2019 13:28:36 +0200 Subject: Fix Null Pointer Issue Add dependent child service to service Issue-ID: SDC-1987 Change-Id: I99418251ffc45f025fe9cd4505159a20ea115e86 Signed-off-by: shrek2000 --- .../sdc/be/components/merge/input/DeclaredInputsResolver.java | 1 + .../be/components/merge/property/PropertyInstanceMergeDataBuilder.java | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) (limited to 'catalog-be/src') diff --git a/catalog-be/src/main/java/org/openecomp/sdc/be/components/merge/input/DeclaredInputsResolver.java b/catalog-be/src/main/java/org/openecomp/sdc/be/components/merge/input/DeclaredInputsResolver.java index 6f60776d2f..28e1b93ec8 100644 --- a/catalog-be/src/main/java/org/openecomp/sdc/be/components/merge/input/DeclaredInputsResolver.java +++ b/catalog-be/src/main/java/org/openecomp/sdc/be/components/merge/input/DeclaredInputsResolver.java @@ -66,6 +66,7 @@ public class DeclaredInputsResolver { private List prepareInputsForRedeclaration(Map oldInputsById, RedeclareInputData redeclareInputData) { List inputsForRedeclaration = redeclareInputData.declaredInputIds.stream() + .filter(oldInputsById::containsKey) .map(oldInputsById::get) .map(InputDefinition::new) .collect(Collectors.toList()); diff --git a/catalog-be/src/main/java/org/openecomp/sdc/be/components/merge/property/PropertyInstanceMergeDataBuilder.java b/catalog-be/src/main/java/org/openecomp/sdc/be/components/merge/property/PropertyInstanceMergeDataBuilder.java index 7f9bf1c370..840cf77275 100644 --- a/catalog-be/src/main/java/org/openecomp/sdc/be/components/merge/property/PropertyInstanceMergeDataBuilder.java +++ b/catalog-be/src/main/java/org/openecomp/sdc/be/components/merge/property/PropertyInstanceMergeDataBuilder.java @@ -1,5 +1,6 @@ package org.openecomp.sdc.be.components.merge.property; +import java.util.Objects; import org.openecomp.sdc.be.dao.utils.MapUtil; import org.openecomp.sdc.be.datatypes.elements.GetInputValueDataDefinition; import org.openecomp.sdc.be.datatypes.elements.PropertyDataDefinition; @@ -66,7 +67,7 @@ class PropertyInstanceMergeDataBuilder { private static List getOldDeclaredInputsByUser(List getInputValues, Map oldInputsByName) { return getInputValues.stream().map(GetInputValueDataDefinition::getInputName) .map(oldInputsByName::get) - .filter(oldInput -> oldInput.getInstanceUniqueId() != null) + .filter(oldInput -> Objects.nonNull(oldInput) && oldInput.getInstanceUniqueId() != null) .map(PropertyDataDefinition::getName) .collect(Collectors.toList()); } -- cgit 1.2.3-korg