KEYCLOAK-5702 kcadm delete realm fails with nullpointer

This commit is contained in:
Marko Strukelj 2017-11-09 20:57:49 +01:00
parent dae0fafc8a
commit 7035a4647d

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;