From 0e3069b0da44920eb01d5361687e05ff1f3399f3 Mon Sep 17 00:00:00 2001 From: geethkokila Date: Mon, 15 Jan 2018 15:24:27 +0530 Subject: [PATCH] Changing the generic application retrieval to get the application ids This fixes the issue caused due to retrieving the application details by submiting the device id, becasue at the first storing of the application, they are not stored agaist a device. It get's mapped later with the device. Hence it caused a null pointer --- .../core/app/mgt/ApplicationManagerProviderServiceImpl.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/app/mgt/ApplicationManagerProviderServiceImpl.java b/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/app/mgt/ApplicationManagerProviderServiceImpl.java index a5e454af9ff..57338e8e190 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/app/mgt/ApplicationManagerProviderServiceImpl.java +++ b/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/app/mgt/ApplicationManagerProviderServiceImpl.java @@ -239,7 +239,7 @@ public class ApplicationManagerProviderServiceImpl implements ApplicationManagem } if (!installedAppList.contains(application)) { installedApp = applicationDAO.getApplication(application.getApplicationIdentifier(), - application.getVersion(), device.getId(), tenantId); + application.getVersion(), tenantId); if (installedApp == null) { appsToAdd.add(application); } else { @@ -255,7 +255,7 @@ public class ApplicationManagerProviderServiceImpl implements ApplicationManagem // Getting the applications ids for the second time for (Application application : appsToAdd) { installedApp = applicationDAO.getApplication(application.getApplicationIdentifier(), - application.getVersion(), device.getId(), tenantId); + application.getVersion(), tenantId); application.setId(installedApp.getId()); applicationsToMap.add(application); }