From ada570f0a017156513b24190e0d8635cff6629c3 Mon Sep 17 00:00:00 2001 From: Ace Date: Fri, 20 Nov 2020 16:11:43 +0530 Subject: [PATCH] fixing NPE when processing operations --- .../mgt/core/operation/mgt/dao/util/OperationDAOUtil.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/operation/mgt/dao/util/OperationDAOUtil.java b/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/operation/mgt/dao/util/OperationDAOUtil.java index c58b75e745..0d83c755cd 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/operation/mgt/dao/util/OperationDAOUtil.java +++ b/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/operation/mgt/dao/util/OperationDAOUtil.java @@ -231,6 +231,10 @@ public class OperationDAOUtil { if (rs.getBoolean("IS_LARGE_RESPONSE")) { largeResponseIDs.add(rs.getInt("OP_RES_ID")); } else { + if(activityStatus.getResponses() == null){ + List operationResponses = new ArrayList<>(); + activityStatus.setResponses(operationResponses); + } activityStatus.getResponses().add(OperationDAOUtil.getOperationResponse(rs)); } }