From d39e7661feca36e3fe018a77ad0b4259b03b2153 Mon Sep 17 00:00:00 2001 From: sadilchamishka Date: Mon, 18 Dec 2023 13:03:38 +0530 Subject: [PATCH] Address review comments --- .../listener/SharingOrganizationCreatorUserEventHandler.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/components/org.wso2.carbon.identity.organization.management.organization.user.sharing/src/main/java/org/wso2/carbon/identity/organization/management/organization/user/sharing/listener/SharingOrganizationCreatorUserEventHandler.java b/components/org.wso2.carbon.identity.organization.management.organization.user.sharing/src/main/java/org/wso2/carbon/identity/organization/management/organization/user/sharing/listener/SharingOrganizationCreatorUserEventHandler.java index 40fcfa9a2..19e200f44 100644 --- a/components/org.wso2.carbon.identity.organization.management.organization.user.sharing/src/main/java/org/wso2/carbon/identity/organization/management/organization/user/sharing/listener/SharingOrganizationCreatorUserEventHandler.java +++ b/components/org.wso2.carbon.identity.organization.management.organization.user.sharing/src/main/java/org/wso2/carbon/identity/organization/management/organization/user/sharing/listener/SharingOrganizationCreatorUserEventHandler.java @@ -137,6 +137,9 @@ public void handleEvent(Event event) throws IdentityEventException { private boolean isAuthenticatedFromConsoleApp() { + if (!(IdentityUtil.threadLocalProperties.get().get(FrameworkConstants.SERVICE_PROVIDER) instanceof String)) { + return false; + } String authenticatedApp = (String) IdentityUtil.threadLocalProperties.get() .get(FrameworkConstants.SERVICE_PROVIDER); return FrameworkConstants.Application.CONSOLE_APP.equals(authenticatedApp);