Fixed SvcLogicContext.toJsonString() to return the empty string ()
if it cannot find the requested prefix in the service logic context.
Change-Id: I5e36864f961b36b6c82a3db8d20483df6686ed15
Issue-ID: CCSDK-2990
Signed-off-by: Dan Timoney <dtimoney@att.com>
String jsonString = this.toJsonString();
JsonObject jsonRoot = (JsonObject) jp.parse(jsonString);
JsonObject targetJson = jsonRoot.getAsJsonObject(pfx);
- return(targetJson.toString());
+ if (targetJson == null) {
+ return("");
+ } else {
+ return(targetJson.toString());
+ }
}
public String toJsonString() {