From b8197bc182a58c1490529b5151834df466fc7730 Mon Sep 17 00:00:00 2001 From: Saad Sahibjan Date: Sat, 30 May 2020 01:50:17 +0530 Subject: [PATCH] Prevent NPE when checking for monitoring operations --- .../device/mgt/core/operation/mgt/OperationManagerImpl.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/operation/mgt/OperationManagerImpl.java b/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/operation/mgt/OperationManagerImpl.java index 8620657a187..9377015bf43 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/operation/mgt/OperationManagerImpl.java +++ b/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/operation/mgt/OperationManagerImpl.java @@ -875,7 +875,7 @@ public class OperationManagerImpl implements OperationManager { List monitoringOperations = operationMonitoringTaskConfig.getMonitoringOperation(); MonitoringOperation currentMonitoringOperation = null; for (MonitoringOperation monitoringOperation : monitoringOperations) { - if (operation.getCode().equals(monitoringOperation.getTaskName())) { + if (monitoringOperation.getTaskName().equals(operation.getCode())) { currentMonitoringOperation = monitoringOperation; break; }