From fc7776d736c5788852500be00eb590f84ec909a0 Mon Sep 17 00:00:00 2001 From: harshanl Date: Mon, 21 Dec 2015 17:13:07 +0530 Subject: [PATCH] Added null checks for empty regid scenarios as a fix for MDM-396 --- .../carbon/device/mgt/mobile/impl/android/gcm/GCMUtil.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.mobile.impl/src/main/java/org/wso2/carbon/device/mgt/mobile/impl/android/gcm/GCMUtil.java b/components/device-mgt/org.wso2.carbon.device.mgt.mobile.impl/src/main/java/org/wso2/carbon/device/mgt/mobile/impl/android/gcm/GCMUtil.java index 12db04ec5..6e59b2d43 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.mobile.impl/src/main/java/org/wso2/carbon/device/mgt/mobile/impl/android/gcm/GCMUtil.java +++ b/components/device-mgt/org.wso2.carbon.device.mgt.mobile.impl/src/main/java/org/wso2/carbon/device/mgt/mobile/impl/android/gcm/GCMUtil.java @@ -123,6 +123,9 @@ public class GCMUtil { //Set device reg-ids JsonArray regIds = new JsonArray(); for (String regId : registrationIds) { + if (regId == null && regId.isEmpty()) { + continue; + } regIds.add(new JsonPrimitive(regId)); }