Merge pull request #26 from milanperera/master

Added null check to MonitoringManagerImpl
revert-70aa11f8
Dilshan Edirisuriya 9 years ago
commit 6cff144573

@ -95,6 +95,7 @@ public class MonitoringManagerImpl implements MonitoringManager {
ComplianceData cmd = monitoringDAO.getCompliance(device.getId());
complianceData = monitoringService.checkPolicyCompliance(deviceIdentifier,
policy, deviceResponse);
complianceData.setId(cmd.getId());
complianceData.setPolicy(policy);
complianceFeatures = complianceData.getComplianceFeatures();
@ -108,7 +109,7 @@ public class MonitoringManagerImpl implements MonitoringManager {
//This was added because update query below that did not return the update table primary key.
if (!complianceFeatures.isEmpty()) {
if (complianceFeatures != null && !complianceFeatures.isEmpty()) {
PolicyManagementDAOFactory.beginTransaction();
monitoringDAO.setDeviceAsNoneCompliance(device.getId(), policy.getId());
if (log.isDebugEnabled()) {

Loading…
Cancel
Save