You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by re...@apache.org on 2026/05/25 19:03:54 UTC
(tomcat) branch 10.1.x updated: Add null check
This is an automated email from the ASF dual-hosted git repository.
rmaucher pushed a commit to branch 10.1.x
in repository https://gitbox.apache.org/repos/asf/tomcat.git
The following commit(s) were added to refs/heads/10.1.x by this push:
new 50eb06b3ae Add null check
50eb06b3ae is described below
commit 50eb06b3ae96b6770ef16681e4afc86c0a199d2a
Author: remm <re...@apache.org>
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: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org