aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/main/java/org/openecomp/sdc/tosca/parser/impl/SdcCsarHelperImpl.java10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/main/java/org/openecomp/sdc/tosca/parser/impl/SdcCsarHelperImpl.java b/src/main/java/org/openecomp/sdc/tosca/parser/impl/SdcCsarHelperImpl.java
index eae0aac..3b87986 100644
--- a/src/main/java/org/openecomp/sdc/tosca/parser/impl/SdcCsarHelperImpl.java
+++ b/src/main/java/org/openecomp/sdc/tosca/parser/impl/SdcCsarHelperImpl.java
@@ -798,8 +798,14 @@ public class SdcCsarHelperImpl implements ISdcCsarHelper {
//Assumed to be unique property for the list
private NodeTemplate getNodeTemplateByCustomizationUuid(List<NodeTemplate> nodeTemplates, String customizationId) {
- Optional<NodeTemplate> findFirst = nodeTemplates.stream().filter(x -> (x.getMetaData() != null && customizationId.equals(x.getMetaData().getValue(PROPERTY_NAME_CUSTOMIZATIONUUID)))).findFirst();
- return findFirst.isPresent() ? findFirst.get() : null;
+ if (customizationId != null) {
+ Optional<NodeTemplate> findFirst = nodeTemplates.stream().filter(x -> (x.getMetaData() != null && customizationId.equals(x.getMetaData().getValue(PROPERTY_NAME_CUSTOMIZATIONUUID)))).findFirst();
+ return findFirst.isPresent() ? findFirst.get() : null;
+ }
+ else {
+ log.error("getNodeTemplateByCustomizationUuid - customizationId is null");
+ return null;
+ }
}
private Object processProperties(String[] split, LinkedHashMap<String, Property> properties) {