This is an automated email from the ASF dual-hosted git repository.

rmaucher pushed a commit to branch 11.0.x
in repository https://gitbox.apache.org/repos/asf/tomcat.git


The following commit(s) were added to refs/heads/11.0.x by this push:
     new 67d10fa936 Add null check
67d10fa936 is described below

commit 67d10fa936c04e1873504b4a69b7ba859d8ef320
Author: remm <[email protected]>
AuthorDate: Mon May 25 21:02:31 2026 +0200

    Add null check
---
 java/org/apache/catalina/valves/ValveBase.java | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/java/org/apache/catalina/valves/ValveBase.java 
b/java/org/apache/catalina/valves/ValveBase.java
index f9c1a16d58..0bbf8b81e8 100644
--- a/java/org/apache/catalina/valves/ValveBase.java
+++ b/java/org/apache/catalina/valves/ValveBase.java
@@ -25,6 +25,7 @@ import org.apache.catalina.Valve;
 import org.apache.catalina.util.LifecycleMBeanBase;
 import org.apache.catalina.util.ToStringUtil;
 import org.apache.juli.logging.Log;
+import org.apache.juli.logging.LogFactory;
 import org.apache.tomcat.util.res.StringManager;
 
 /**
@@ -34,6 +35,8 @@ import org.apache.tomcat.util.res.StringManager;
  */
 public abstract class ValveBase extends LifecycleMBeanBase implements 
Contained, Valve {
 
+    private static final Log log = LogFactory.getLog(ValveBase.class);
+
     /**
      * StringManager for internationalized strings.
      */
@@ -144,7 +147,8 @@ public abstract class ValveBase extends LifecycleMBeanBase 
implements Contained,
     @Override
     protected void initInternal() throws LifecycleException {
         super.initInternal();
-        containerLog = getContainer().getLogger();
+        Container container = getContainer();
+        containerLog = container != null ? container.getLogger() : log;
     }
 
 


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to