diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/impl/DeviceManagementServiceImpl.java b/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/impl/DeviceManagementServiceImpl.java index 572cdcf8845..9d9448653a1 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/impl/DeviceManagementServiceImpl.java +++ b/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/impl/DeviceManagementServiceImpl.java @@ -476,6 +476,7 @@ public class DeviceManagementServiceImpl implements DeviceManagementService { JSONObject obj = new JSONObject(DeviceAPIClientServiceImpl.returnUser(currentUser)); log.info("================="); + log.info(currentUser); log.info(obj.toString()); log.info("=================="); if(obj.has("error")){ diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/traccar/api/service/addons/TraccarClientImpl.java b/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/traccar/api/service/addons/TraccarClientImpl.java index 1beba4a859a..7b3458bbcf3 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/traccar/api/service/addons/TraccarClientImpl.java +++ b/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/traccar/api/service/addons/TraccarClientImpl.java @@ -176,7 +176,9 @@ public class TraccarClientImpl implements TraccarClient { traccarUser.setId(obj.getInt("id")); traccarUser.setName(obj.getString("name")); - traccarUser.setLogin(obj.getString("login")); + if(!obj.isNull("login")){ + traccarUser.setLogin(obj.getString("login")); + } traccarUser.setEmail(obj.getString("email")); traccarUser.setDeviceLimit(obj.getInt("deviceLimit")); traccarUser.setUserLimit(obj.getInt("userLimit"));