KEYCLOAK-12436 Fixes NPE in QuarkusCacheManagerProvider when default settings are used

org.keycloak.provider.quarkus.QuarkusCacheManagerProvider#loadDefaultConfiguration
fails with an NPE (while trying to unbox null into a boolean) if the current
config does not contain "clustered". This happens when quarkus:dev mode is used
without parameters.
This commit is contained in:
Thomas Darimont 2019-12-10 21:35:56 +01:00 committed by Pedro Igor
parent 0f3e0f4d4e
commit 6591bdcdf5

View file

@ -77,7 +77,7 @@ public final class QuarkusCacheManagerProvider implements ManagedCacheManagerPro
}
private InputStream loadDefaultConfiguration(Config.Scope config) throws FileNotFoundException {
if (config.getBoolean("clustered")) {
if (config.getBoolean("clustered", false)) {
log.debugf("Using default clustered cache configuration.");
return FileLookupFactory.newInstance()
.lookupFileStrict("default-clustered-cache.xml", Thread.currentThread().getContextClassLoader());