From 00f293346ed73585faea502c6fc6bac1481f7422 Mon Sep 17 00:00:00 2001 From: MichaelMorris Date: Fri, 26 Aug 2022 16:56:59 +0100 Subject: Fix NPE for no inputs on instance operation Signed-off-by: MichaelMorris Issue-ID: SDC-4145 Change-Id: I6813382db7101de0c18d03a058c2c36a48b5a828 --- .../openecomp/sdc/be/components/impl/ServiceImportBusinessLogic.java | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'catalog-be/src/main/java/org') diff --git a/catalog-be/src/main/java/org/openecomp/sdc/be/components/impl/ServiceImportBusinessLogic.java b/catalog-be/src/main/java/org/openecomp/sdc/be/components/impl/ServiceImportBusinessLogic.java index 0a7ce20015..bf0f1b2812 100644 --- a/catalog-be/src/main/java/org/openecomp/sdc/be/components/impl/ServiceImportBusinessLogic.java +++ b/catalog-be/src/main/java/org/openecomp/sdc/be/components/impl/ServiceImportBusinessLogic.java @@ -1997,6 +1997,10 @@ public class ServiceImportBusinessLogic { private void mergeOperationInputDefinitions(ListDataDefinition inputsFromNodeType, ListDataDefinition instanceInputs) { + if (inputsFromNodeType == null || CollectionUtils.isEmpty(inputsFromNodeType.getListToscaDataDefinition()) || instanceInputs == null + || CollectionUtils.isEmpty(instanceInputs.getListToscaDataDefinition())) { + return; + } instanceInputs.getListToscaDataDefinition().forEach( instanceInput -> inputsFromNodeType.getListToscaDataDefinition().stream().filter( templateInput -> templateInput.getName().equals(instanceInput.getName()) -- cgit 1.2.3-korg