From 143569b83bdff47161393ec3d7e556967e654140 Mon Sep 17 00:00:00 2001 From: Hasunie Date: Thu, 16 Mar 2017 12:26:37 +0530 Subject: [PATCH] Fixing null property in AndriodAPIUtils --- .../wso2/carbon/mdm/services/android/util/AndroidAPIUtils.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/util/AndroidAPIUtils.java b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/util/AndroidAPIUtils.java index e14b57dad..39381f3cb 100644 --- a/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/util/AndroidAPIUtils.java +++ b/components/mobile-plugins/android-plugin/org.wso2.carbon.device.mgt.mobile.android.api/src/main/java/org/wso2/carbon/mdm/services/android/util/AndroidAPIUtils.java @@ -490,7 +490,8 @@ public class AndroidAPIUtils { if (exist) { return ob.getValue().getAsString().replace("%", ""); } - if (ob.getValue().getAsString().equalsIgnoreCase(needed)) { + JsonElement val = ob.getValue(); + if (val != null && !val.isJsonNull() && ob.getValue().getAsString().equalsIgnoreCase(needed)) { exist = true; } }