Fixing the null pointer issue in policy manager

4.x.x
geethkokila 8 years ago
parent c42260feb6
commit 2b7d5fd66b

@ -70,7 +70,10 @@ public class PolicyFilterImpl implements PolicyFilter {
Map<Integer, Policy> policyMap = new HashMap<>(); Map<Integer, Policy> policyMap = new HashMap<>();
for (Policy policy : policies) { for (Policy policy : policies) {
List<DeviceGroupWrapper> wrappers = policy.getDeviceGroups(); List<DeviceGroupWrapper> 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); temp.add(policy);
policyMap.put(policy.getId(), policy); policyMap.put(policy.getId(), policy);
continue; continue;

Loading…
Cancel
Save