From e5d7512d0a3d3c03f89be23a4d6054fc93897306 Mon Sep 17 00:00:00 2001 From: Pahansith Gunathilake Date: Thu, 24 Nov 2022 18:26:18 +0530 Subject: [PATCH] fix traccar nullpointer error --- .../mgt/core/traccar/api/service/TraccarClientFactory.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/traccar/api/service/TraccarClientFactory.java b/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/traccar/api/service/TraccarClientFactory.java index 193bdb211c1..e0124c53efd 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/traccar/api/service/TraccarClientFactory.java +++ b/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/traccar/api/service/TraccarClientFactory.java @@ -626,7 +626,9 @@ public class TraccarClientFactory { authorizedKey(HttpReportingUtil.trackerUser(), HttpReportingUtil.trackerPassword()), serverUrl(HttpReportingUtil.trackerServer()))); String result = res.get(); - log.info("Group " + trackerGroupInfo.getGroupId() + " has been added to Traccar."); + if (null != trackerGroupInfo) { + log.info("Group " + trackerGroupInfo.getGroupId() + " has been added to Traccar."); + } if (res.isDone() && result.charAt(0) == '{') { JSONObject obj = new JSONObject(result); if (obj.has("id")) {