Commit 51dba333 authored by Spiros Koulouzis's avatar Spiros Koulouzis

check if key is present

parent 698454ae
......@@ -468,33 +468,34 @@ public class DeployService {
jo.put("result", result);
}
}
JSONObject invocation = ((JSONObject) (result).get("invocation"));
if (invocation.has("module_args")) {
JSONObject module_args = (JSONObject) invocation.get("module_args");
if (module_args.has("msg")) {
if (result.has("invocation")) {
JSONObject invocation = ((JSONObject) (result).get("invocation"));
if (invocation.has("module_args")) {
JSONObject module_args = (JSONObject) invocation.get("module_args");
if (module_args.has("msg")) {
String msg;
try {
msg = (String) module_args.get("msg");
} catch (java.lang.ClassCastException ex) {
JSONObject message = (JSONObject) module_args.get("msg");
msg = Converter.jsonObject2String(message.toString());
module_args.put("msg", msg);
invocation.put("module_args", module_args);
}
}
}
if (invocation.has("msg")) {
String msg;
try {
msg = (String) module_args.get("msg");
msg = (String) invocation.get("msg");
} catch (java.lang.ClassCastException ex) {
JSONObject message = (JSONObject) module_args.get("msg");
JSONObject message = (JSONObject) invocation.get("msg");
msg = Converter.jsonObject2String(message.toString());
module_args.put("msg", msg);
invocation.put("module_args", module_args);
invocation.put("msg", msg);
result.put("invocation", invocation);
}
}
}
if (invocation.has("msg")) {
String msg;
try {
msg = (String) invocation.get("msg");
} catch (java.lang.ClassCastException ex) {
JSONObject message = (JSONObject) invocation.get("msg");
msg = Converter.jsonObject2String(message.toString());
invocation.put("msg", msg);
result.put("invocation", invocation);
}
}
newJa.put(jo);
}
......
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