diff --git a/model/infinispan/src/main/java/org/keycloak/models/cache/infinispan/organization/InfinispanOrganizationProvider.java b/model/infinispan/src/main/java/org/keycloak/models/cache/infinispan/organization/InfinispanOrganizationProvider.java index 54634979be..b0e86723e4 100644 --- a/model/infinispan/src/main/java/org/keycloak/models/cache/infinispan/organization/InfinispanOrganizationProvider.java +++ b/model/infinispan/src/main/java/org/keycloak/models/cache/infinispan/organization/InfinispanOrganizationProvider.java @@ -236,6 +236,10 @@ public class InfinispanOrganizationProvider implements OrganizationProvider { @Override public boolean isManagedMember(OrganizationModel organization, UserModel user) { + if (user == null) { + return false; + } + String cacheKey = cacheKeyMembership(getRealm(), organization, user); CachedMembership cached = realmCache.getCache().get(cacheKey, CachedMembership.class); diff --git a/model/storage-private/src/main/java/org/keycloak/storage/UserStorageManager.java b/model/storage-private/src/main/java/org/keycloak/storage/UserStorageManager.java index b86a44b131..894b16a444 100755 --- a/model/storage-private/src/main/java/org/keycloak/storage/UserStorageManager.java +++ b/model/storage-private/src/main/java/org/keycloak/storage/UserStorageManager.java @@ -116,7 +116,6 @@ public class UserStorageManager extends AbstractStorageManager