diff --git a/components/policy-mgt/org.wso2.carbon.policy.mgt.core/src/main/java/org/wso2/carbon/policy/mgt/core/impl/PolicyFilterImpl.java b/components/policy-mgt/org.wso2.carbon.policy.mgt.core/src/main/java/org/wso2/carbon/policy/mgt/core/impl/PolicyFilterImpl.java index 18cf7a15601..f589d5bfd2e 100644 --- a/components/policy-mgt/org.wso2.carbon.policy.mgt.core/src/main/java/org/wso2/carbon/policy/mgt/core/impl/PolicyFilterImpl.java +++ b/components/policy-mgt/org.wso2.carbon.policy.mgt.core/src/main/java/org/wso2/carbon/policy/mgt/core/impl/PolicyFilterImpl.java @@ -70,7 +70,10 @@ public class PolicyFilterImpl implements PolicyFilter { Map policyMap = new HashMap<>(); for (Policy policy : policies) { List wrappers = policy.getDeviceGroups(); - if (PolicyManagementConstants.ANY.equalsIgnoreCase(wrappers.get(0).getName())) { + if (wrappers.isEmpty()) { + temp.add(policy); + continue; + } else if (PolicyManagementConstants.ANY.equalsIgnoreCase(wrappers.get(0).getName())) { temp.add(policy); policyMap.put(policy.getId(), policy); continue;