Merge pull request #4663 from mstruk/KEYCLOAK-5702

KEYCLOAK-5702 kcadm delete realm fails with nullpointer
This commit is contained in:
Bill Burke 2017-11-17 11:57:58 -05:00 committed by GitHub
commit ff5010cdd0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -82,6 +82,9 @@ public class UserStorageManager implements UserProvider, OnUserCache, OnCreateCo
UserStorageProvider instance = (UserStorageProvider)session.getAttribute(model.getId());
if (instance != null) return instance;
instance = factory.create(session, model);
if (instance == null) {
throw new IllegalStateException("UserStorageProvideFactory (of type " + factory.getClass().getName() + ") produced a null instance");
}
session.enlistForClose(instance);
session.setAttribute(model.getId(), instance);
return instance;