From 93fa110a081685ea51f478902de95706aa522d84 Mon Sep 17 00:00:00 2001 From: lasanthaDLPDS Date: Sun, 28 Apr 2019 20:08:10 +0530 Subject: [PATCH] Fix App update issue --- .../application/mgt/core/impl/ApplicationManagerImpl.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.core/src/main/java/org/wso2/carbon/device/application/mgt/core/impl/ApplicationManagerImpl.java b/components/application-mgt/org.wso2.carbon.device.application.mgt.core/src/main/java/org/wso2/carbon/device/application/mgt/core/impl/ApplicationManagerImpl.java index a4996c9a7ea..e5aa75acd73 100644 --- a/components/application-mgt/org.wso2.carbon.device.application.mgt.core/src/main/java/org/wso2/carbon/device/application/mgt/core/impl/ApplicationManagerImpl.java +++ b/components/application-mgt/org.wso2.carbon.device.application.mgt.core/src/main/java/org/wso2/carbon/device/application/mgt/core/impl/ApplicationManagerImpl.java @@ -1493,7 +1493,11 @@ public class ApplicationManagerImpl implements ApplicationManager { List appUnrestrictedRoles = this.visibilityDAO.getUnrestrictedRoles(applicationId, tenantId); boolean isExistingAppRestricted = !appUnrestrictedRoles.isEmpty(); - boolean isUpdatingAppRestricted = !applicationUpdateWrapper.getUnrestrictedRoles().isEmpty(); + boolean isUpdatingAppRestricted = false; + if (applicationUpdateWrapper.getUnrestrictedRoles() != null && !applicationUpdateWrapper + .getUnrestrictedRoles().isEmpty()) { + isUpdatingAppRestricted = true; + } if (isExistingAppRestricted && !isUpdatingAppRestricted) { visibilityDAO.deleteUnrestrictedRoles(appUnrestrictedRoles, applicationId, tenantId);