From ab88cef747b6aac5b7b652b0af064771953d7af3 Mon Sep 17 00:00:00 2001 From: Oleksandr Moliavko Date: Mon, 15 Jul 2019 10:20:42 +0300 Subject: Added null check for yaml to prevent crash at getParameterListFromEnvt() Issue-ID: SO-1841 Signed-off-by: Oleksandr Moliavko Change-Id: I8fabba8d99e311f01a5fd5dad166e0bb643044e3 --- .../org/onap/so/openstack/utils/MsoHeatEnvironmentEntry.java | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'adapters/mso-adapter-utils/src') 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 723bed17f7..8cacf8526a 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 @@ public class MsoHeatEnvironmentEntry { 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 { -- cgit 1.2.3-korg