Commit 0722a521 authored by Spiros Koulouzis's avatar Spiros Koulouzis

Null checks

parent 13ffcc8f
...@@ -124,11 +124,17 @@ public class ProvisionController { ...@@ -124,11 +124,17 @@ public class ProvisionController {
List<Parameter> topologies = buildTopologyParams(pReq.getPlanID()); List<Parameter> topologies = buildTopologyParams(pReq.getPlanID());
parameters.addAll(topologies); parameters.addAll(topologies);
List<Parameter> userScripts = buildScriptParams(pReq.getUserScriptID()); String scriptID = pReq.getUserScriptID();
parameters.addAll(userScripts); if (scriptID != null) {
List<Parameter> userScripts = buildScriptParams(scriptID);
parameters.addAll(userScripts);
}
List<Parameter> userKeys = buildKeysParams(pReq.getUserKeyID()); String userKeyID = pReq.getUserKeyID();
parameters.addAll(userKeys); if (userKeyID != null) {
List<Parameter> userKeys = buildKeysParams(userKeyID);
parameters.addAll(userKeys);
}
invokationMessage.setParameters(parameters); invokationMessage.setParameters(parameters);
invokationMessage.setCreationDate((System.currentTimeMillis())); invokationMessage.setCreationDate((System.currentTimeMillis()));
......
...@@ -57,7 +57,8 @@ public class Converter { ...@@ -57,7 +57,8 @@ public class Converter {
public static String map2YmlString(Map<String, Object> map) throws JSONException { public static String map2YmlString(Map<String, Object> map) throws JSONException {
JSONObject jsonObject = new JSONObject(map); JSONObject jsonObject = new JSONObject(map);
return json2Yml2(jsonObject.toString()); String yamlStr = json2Yml2(jsonObject.toString());
return yamlStr;
} }
public static String map2JsonString(Map<String, Object> map) { public static String map2JsonString(Map<String, Object> map) {
...@@ -105,7 +106,8 @@ public class Converter { ...@@ -105,7 +106,8 @@ public class Converter {
public static String json2Yml2(String jsonString) throws JSONException { public static String json2Yml2(String jsonString) throws JSONException {
Yaml yaml = new Yaml(); Yaml yaml = new Yaml();
return yaml.dump(ymlString2Map(jsonString)); String yamlStr = yaml.dump(ymlString2Map(jsonString));
return yamlStr;
} }
public static Properties Object2Properties(Object obj) throws JsonProcessingException, JSONException { public static Properties Object2Properties(Object obj) throws JsonProcessingException, JSONException {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment