Merge pull request 'Fix traccar null pointer error' (#20) from pahansith/device-mgt-core:traccar-fix into master

Reviewed-on: https://repository.entgra.net/community/device-mgt-core/pulls/20
This commit is contained in:
Pahansith Gunathilake 2022-11-24 12:58:22 +00:00
commit 49a1ab9516

View File

@ -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")) {