aboutsummaryrefslogtreecommitdiffstats
path: root/src/main/java/org/onap/sdc/toscaparser/api/DataEntity.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java/org/onap/sdc/toscaparser/api/DataEntity.java')
-rw-r--r--src/main/java/org/onap/sdc/toscaparser/api/DataEntity.java8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/main/java/org/onap/sdc/toscaparser/api/DataEntity.java b/src/main/java/org/onap/sdc/toscaparser/api/DataEntity.java
index 2a12a71..1559e66 100644
--- a/src/main/java/org/onap/sdc/toscaparser/api/DataEntity.java
+++ b/src/main/java/org/onap/sdc/toscaparser/api/DataEntity.java
@@ -49,9 +49,11 @@ public class DataEntity {
else {
if(!(value instanceof LinkedHashMap)) {
//ERROR under investigation
- ThreadLocalsHolder.getCollector().appendValidationIssue(new JToscaValidationIssue("JE001", String.format(
- "TypeMismatchError: \"%s\" is not a map. The type is \"%s\"",
- value.toString(),dataType.getType())));
+ String checkedVal = value != null ? value.toString() : null;
+
+ ThreadLocalsHolder.getCollector().appendValidationIssue(new JToscaValidationIssue("JE001", String.format(
+ "TypeMismatchError: \"%s\" is not a map. The type is \"%s\"",
+ checkedVal, dataType.getType())));
if (value instanceof List && ((List) value).size() > 0) {
value = ((List) value).get(0);