From aa4f7c13c5e5298442a738f6922751c0fabc26b3 Mon Sep 17 00:00:00 2001 From: lasantha Date: Wed, 29 Nov 2017 10:05:50 +0530 Subject: [PATCH] Fixing issue in get device API --- .../mgt/core/service/DeviceManagementProviderServiceImpl.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/service/DeviceManagementProviderServiceImpl.java b/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/service/DeviceManagementProviderServiceImpl.java index a3652faa16f..9939f8c4390 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/service/DeviceManagementProviderServiceImpl.java +++ b/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/service/DeviceManagementProviderServiceImpl.java @@ -709,7 +709,7 @@ public class DeviceManagementProviderServiceImpl implements DeviceManagementProv } finally { DeviceManagementDAOFactory.closeConnection(); } - if (requireDeviceInfo) { + if (requireDeviceInfo && !allDevices.isEmpty()) { paginationResult.setData(getAllDeviceInfo(allDevices)); } else { paginationResult.setData(allDevices);