Fix NPE on service import 18/136018/3
authorMichaelMorris <michael.morris@est.tech>
Mon, 25 Sep 2023 10:16:55 +0000 (11:16 +0100)
committerVasyl Razinkov <vasyl.razinkov@est.tech>
Mon, 25 Sep 2023 13:54:13 +0000 (13:54 +0000)
Signed-off-by: MichaelMorris <michael.morris@est.tech>
Issue-ID: SDC-4634
Change-Id: Ib5785890d5cfa5b014cf5f4eef9d15855b7ff7e6

catalog-be/src/main/java/org/openecomp/sdc/be/components/impl/ServiceImportBusinessLogic.java

index 7dadbee..6301929 100644 (file)
@@ -2189,6 +2189,9 @@ public class ServiceImportBusinessLogic {
     }
 
     private List<AttributeDefinition> addImplicitAttributeValues(Resource originResource, UploadComponentInstanceInfo uploadComponentInstanceInfo) {
+        if (uploadComponentInstanceInfo.getAttributes() == null) {
+            return  Collections.emptyList();
+        }
         List<String> origAttributes = originResource.getAttributes().stream().map(AttributeDefinition::getName).collect(toList());
         Map<String, UploadAttributeInfo> uploadAttributes = uploadComponentInstanceInfo.getAttributes();
         List<String> newAttributesToAdd =