Merge "Enhanced List Level flow with backward support"
[so.git] / adapters / mso-adapter-utils / src / main / java / org / onap / so / openstack / utils / MsoHeatEnvironmentEntry.java
index a21db78..8cacf85 100644 (file)
@@ -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 {
@@ -70,7 +73,7 @@ public class MsoHeatEnvironmentEntry {
             logger.debug("Exception:", e);
             this.valid = false;
             this.errorString = e.getMessage();
-            // e.printStackTrace();
+
         }
     }
 
@@ -173,7 +176,7 @@ public class MsoHeatEnvironmentEntry {
         // Basically give back the envt - but exclude the params that aren't in the HeatTemplate
 
         StringBuilder sb = new StringBuilder();
-        ArrayList<String> paramNameList = new ArrayList<String>(params.size());
+        ArrayList<String> paramNameList = new ArrayList<>(params.size());
         for (HeatTemplateParam htp : params) {
             paramNameList.add(htp.getParamName());
         }