aboutsummaryrefslogtreecommitdiffstats
path: root/catalog-be/src
diff options
context:
space:
mode:
Diffstat (limited to 'catalog-be/src')
-rw-r--r--catalog-be/src/main/java/org/openecomp/sdc/be/servlets/AttributeServlet.java8
1 files changed, 8 insertions, 0 deletions
diff --git a/catalog-be/src/main/java/org/openecomp/sdc/be/servlets/AttributeServlet.java b/catalog-be/src/main/java/org/openecomp/sdc/be/servlets/AttributeServlet.java
index 6ea2ab1096..4056d607ad 100644
--- a/catalog-be/src/main/java/org/openecomp/sdc/be/servlets/AttributeServlet.java
+++ b/catalog-be/src/main/java/org/openecomp/sdc/be/servlets/AttributeServlet.java
@@ -115,6 +115,10 @@ public class AttributeServlet extends AbstractValidationsServlet {
try {
final Wrapper<ResponseFormat> errorWrapper = new Wrapper<>();
AttributeDefinition attributeDataDefinition = convertJsonToObject(data, errorWrapper);
+ if (attributeDataDefinition == null) {
+ log.error("Unexpected null value for `attributeDataDefinition`");
+ return buildErrorResponse(errorWrapper.getInnerElement());
+ }
if (errorWrapper.isEmpty()) {
AttributeBusinessLogic businessLogic = getClassFromWebAppContext(context, () -> AttributeBusinessLogic.class);
Either<AttributeDefinition, ResponseFormat> createAttribute = businessLogic
@@ -175,6 +179,10 @@ public class AttributeServlet extends AbstractValidationsServlet {
try {
final Wrapper<ResponseFormat> errorWrapper = new Wrapper<>();
AttributeDefinition attributeDataDefinition = convertJsonToObject(data, errorWrapper);
+ if (attributeDataDefinition == null) {
+ log.error("Unexpected null value for `attributeDataDefinition`");
+ return buildErrorResponse(errorWrapper.getInnerElement());
+ }
if (errorWrapper.isEmpty()) {
AttributeBusinessLogic businessLogic = getClassFromWebAppContext(context, () -> AttributeBusinessLogic.class);
Either<AttributeDefinition, ResponseFormat> eitherUpdateAttribute = businessLogic