Added null check for yaml to prevent crash at
getParameterListFromEnvt()
Issue-ID: SO-1841
Signed-off-by: Oleksandr Moliavko <o.moliavko@samsung.com>
Change-Id: I8fabba8d99e311f01a5fd5dad166e0bb643044e3
diff --git a/adapters/mso-adapter-utils/src/main/java/org/onap/so/openstack/utils/MsoHeatEnvironmentEntry.java b/adapters/mso-adapter-utils/src/main/java/org/onap/so/openstack/utils/MsoHeatEnvironmentEntry.java
index 723bed1..8cacf85 100644
--- a/adapters/mso-adapter-utils/src/main/java/org/onap/so/openstack/utils/MsoHeatEnvironmentEntry.java
+++ b/adapters/mso-adapter-utils/src/main/java/org/onap/so/openstack/utils/MsoHeatEnvironmentEntry.java
@@ -58,9 +58,12 @@
return;
byte[] b = this.rawEntry.toString().getBytes();
MsoYamlEditorWithEnvt yaml = new MsoYamlEditorWithEnvt(b);
- this.parameters = yaml.getParameterListFromEnvt();
- // this.resources = yaml.getResourceListFromEnvt();
- StringBuilder sb = this.getResourceRegistryRawEntry();
+ StringBuilder sb = null;
+ if (yaml != null) {
+ this.parameters = yaml.getParameterListFromEnvt();
+ // this.resources = yaml.getResourceListFromEnvt();
+ sb = this.getResourceRegistryRawEntry();
+ }
if (sb == null) {
this.resourceRegistryEntryRaw = new StringBuilder("");
} else {