diff options
Diffstat (limited to 'catalog-model/src')
-rw-r--r-- | catalog-model/src/main/java/org/openecomp/sdc/be/model/InterfaceDefinition.java | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/catalog-model/src/main/java/org/openecomp/sdc/be/model/InterfaceDefinition.java b/catalog-model/src/main/java/org/openecomp/sdc/be/model/InterfaceDefinition.java index 3afd422e0c..e3b5d08bc1 100644 --- a/catalog-model/src/main/java/org/openecomp/sdc/be/model/InterfaceDefinition.java +++ b/catalog-model/src/main/java/org/openecomp/sdc/be/model/InterfaceDefinition.java @@ -21,6 +21,7 @@ package org.openecomp.sdc.be.model; import com.fasterxml.jackson.annotation.JsonIgnore; +import org.apache.commons.collections.MapUtils; import org.openecomp.sdc.be.datatypes.elements.InterfaceDataDefinition; import org.openecomp.sdc.be.datatypes.elements.OperationDataDefinition; @@ -68,11 +69,13 @@ public class InterfaceDefinition extends InterfaceDataDefinition implements IOpe } @JsonIgnore - public void setOperationsMap(Map<String, Operation> operations) { - Map<String, OperationDataDefinition> convertedOperation = operations.entrySet() - .stream() - .collect(Collectors.toMap(Map.Entry::getKey, e -> new OperationDataDefinition(e - .getValue()))); + public void setOperationsMap(final Map<String, Operation> operations) { + if (MapUtils.isEmpty(operations)) { + return; + } + final Map<String, OperationDataDefinition> convertedOperation = operations.entrySet() + .stream() + .collect(Collectors.toMap(Map.Entry::getKey, e -> new OperationDataDefinition(e.getValue()))); setOperations(convertedOperation); } |