From 6591bdcdf5da57b6aff2f35677d86f34f794ed43 Mon Sep 17 00:00:00 2001 From: Thomas Darimont Date: Tue, 10 Dec 2019 21:35:56 +0100 Subject: [PATCH] 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. --- .../keycloak/provider/quarkus/QuarkusCacheManagerProvider.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/quarkus/extensions/src/main/java/org/keycloak/provider/quarkus/QuarkusCacheManagerProvider.java b/quarkus/extensions/src/main/java/org/keycloak/provider/quarkus/QuarkusCacheManagerProvider.java index f86f0b9f87..182f5edf7e 100644 --- a/quarkus/extensions/src/main/java/org/keycloak/provider/quarkus/QuarkusCacheManagerProvider.java +++ b/quarkus/extensions/src/main/java/org/keycloak/provider/quarkus/QuarkusCacheManagerProvider.java @@ -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());