Fixing NPE of EMM-1715

This commit is contained in:
susinda 2016-10-13 12:11:37 +05:30
parent eb20d1fc1c
commit ca68181541

View File

@ -380,8 +380,11 @@ public class MonitoringManagerImpl implements MonitoringManager {
List<String> deviceTypes = new ArrayList<>();
try {
//when shutdown, it sets DeviceManagementService to null, therefore need to have a null check
if (PolicyManagementDataHolder.getInstance().getDeviceManagementService() != null) {
deviceTypes =
PolicyManagementDataHolder.getInstance().getDeviceManagementService().getAvailableDeviceTypes();
}
} catch (DeviceManagementException e) {
throw new PolicyComplianceException("Error occurred while getting the device types.", e);
}