From 5af4785ba1c22a02272e033ab8c58178fcccac51 Mon Sep 17 00:00:00 2001 From: Stian Thorgersen Date: Thu, 2 Jul 2015 09:08:40 +0200 Subject: [PATCH] KEYCLOAK-1507 Tomcat Adapter throws NPE under certain conditions --- .../adapters/tomcat/AbstractKeycloakAuthenticatorValve.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/integration/tomcat/tomcat-core/src/main/java/org/keycloak/adapters/tomcat/AbstractKeycloakAuthenticatorValve.java b/integration/tomcat/tomcat-core/src/main/java/org/keycloak/adapters/tomcat/AbstractKeycloakAuthenticatorValve.java index f415f9f11b..7088b46ef4 100755 --- a/integration/tomcat/tomcat-core/src/main/java/org/keycloak/adapters/tomcat/AbstractKeycloakAuthenticatorValve.java +++ b/integration/tomcat/tomcat-core/src/main/java/org/keycloak/adapters/tomcat/AbstractKeycloakAuthenticatorValve.java @@ -127,7 +127,9 @@ public abstract class AbstractKeycloakAuthenticatorValve extends FormAuthenticat } protected void beforeStop() { - nodesRegistrationManagement.stop(); + if (nodesRegistrationManagement != null) { + nodesRegistrationManagement.stop(); + } } private static InputStream getJSONFromServletContext(ServletContext servletContext) {