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

Null checks

parent 13ffcc8f
......@@ -124,11 +124,17 @@ public class ProvisionController {
List<Parameter> topologies = buildTopologyParams(pReq.getPlanID());
parameters.addAll(topologies);
List<Parameter> userScripts = buildScriptParams(pReq.getUserScriptID());
parameters.addAll(userScripts);
String scriptID = pReq.getUserScriptID();
if (scriptID != null) {
List<Parameter> userScripts = buildScriptParams(scriptID);
parameters.addAll(userScripts);
}
List<Parameter> userKeys = buildKeysParams(pReq.getUserKeyID());
parameters.addAll(userKeys);
String userKeyID = pReq.getUserKeyID();
if (userKeyID != null) {
List<Parameter> userKeys = buildKeysParams(userKeyID);
parameters.addAll(userKeys);
}
invokationMessage.setParameters(parameters);
invokationMessage.setCreationDate((System.currentTimeMillis()));
......
......@@ -57,7 +57,8 @@ public class Converter {
public static String map2YmlString(Map<String, Object> map) throws JSONException {
JSONObject jsonObject = new JSONObject(map);
return json2Yml2(jsonObject.toString());
String yamlStr = json2Yml2(jsonObject.toString());
return yamlStr;
}
public static String map2JsonString(Map<String, Object> map) {
......@@ -105,7 +106,8 @@ public class Converter {
public static String json2Yml2(String jsonString) throws JSONException {
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 {
......
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