Fix the null pointer issue due to missing of owner of the app
@@ -588,7 +588,7 @@ public class ApplicationMgtUtil {
userNameWithDomain = IdentityUtil.addDomainToName(userName, userStoreDomain);
}
org.wso2.carbon.user.api.UserRealm realm = CarbonContext.getThreadLocalCarbonContext().getUserRealm();
- if (realm == null) {
+ if (realm == null || StringUtils.isEmpty(userNameWithDomain)) {
return false;
}
boolean isUserExist = realm.getUserStoreManager().isExistingUser(userNameWithDomain);
