diff --git a/components/org.wso2.carbon.identity.scim2.common/src/main/java/org/wso2/carbon/identity/scim2/common/impl/SCIMRoleManagerV2.java b/components/org.wso2.carbon.identity.scim2.common/src/main/java/org/wso2/carbon/identity/scim2/common/impl/SCIMRoleManagerV2.java index 9eb932fc4..b2aa786f2 100644 --- a/components/org.wso2.carbon.identity.scim2.common/src/main/java/org/wso2/carbon/identity/scim2/common/impl/SCIMRoleManagerV2.java +++ b/components/org.wso2.carbon.identity.scim2.common/src/main/java/org/wso2/carbon/identity/scim2/common/impl/SCIMRoleManagerV2.java @@ -222,7 +222,9 @@ public RoleV2 getRole(String roleID, Map requiredAttributes) // Set associated applications. List associatedApps = convertAssociatedAppsToMultivaluedComplexType(role.getAssociatedApplications()); - scimRole.setAssociatedApplications(associatedApps); + if (CollectionUtils.isNotEmpty(associatedApps)) { + scimRole.setAssociatedApplications(associatedApps); + } return scimRole; } catch (IdentityRoleManagementException e) { if (StringUtils.equals(ROLE_NOT_FOUND.getCode(), e.getErrorCode())) {