diff --git a/components/device-mgt-iot/org.wso2.carbon.device.mgt.iot/src/main/java/org/wso2/carbon/device/mgt/iot/apimgt/ApisAppClient.java b/components/device-mgt-iot/org.wso2.carbon.device.mgt.iot/src/main/java/org/wso2/carbon/device/mgt/iot/apimgt/ApisAppClient.java index ec6a65f9d4..b1cc3ddb6a 100644 --- a/components/device-mgt-iot/org.wso2.carbon.device.mgt.iot/src/main/java/org/wso2/carbon/device/mgt/iot/apimgt/ApisAppClient.java +++ b/components/device-mgt-iot/org.wso2.carbon.device.mgt.iot/src/main/java/org/wso2/carbon/device/mgt/iot/apimgt/ApisAppClient.java @@ -162,8 +162,14 @@ public class ApisAppClient { JSONObject object = jsonSubscriptions.getJSONObject(n); String appName = object.getString("name"); - String prodConsumerKey = object.getString("prodConsumerKey"); - String prodConsumerSecret = object.getString("prodConsumerSecret"); + String prodConsumerKey = null; + String prodConsumerSecret = null; + if(!object.get("prodConsumerKey").equals(null)) { + prodConsumerKey = object.getString("prodConsumerKey"); + } + if(!object.get("prodConsumerSecret").equals(null)) { + prodConsumerSecret = object.getString("prodConsumerSecret"); + } subscriptionMap.put(appName, new String(Base64.encodeBase64( (prodConsumerKey + ":" + prodConsumerSecret).getBytes()))); }