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

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


The following commit(s) were added to refs/heads/9.0.x by this push:
     new 7f781f3f26 Avoid unlikely NPE in debug log
7f781f3f26 is described below

commit 7f781f3f26677819eea84f40ce77c4a7c6ae1b91
Author: remm <[email protected]>
AuthorDate: Wed May 20 10:54:24 2026 +0200

    Avoid unlikely NPE in debug log
---
 java/org/apache/catalina/authenticator/AuthenticatorBase.java | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/java/org/apache/catalina/authenticator/AuthenticatorBase.java 
b/java/org/apache/catalina/authenticator/AuthenticatorBase.java
index 5dec7a252f..b2c1209e2f 100644
--- a/java/org/apache/catalina/authenticator/AuthenticatorBase.java
+++ b/java/org/apache/catalina/authenticator/AuthenticatorBase.java
@@ -633,7 +633,8 @@ public abstract class AuthenticatorBase extends ValveBase 
implements Authenticat
             }
             if (!realm.hasResourcePermission(request, response, constraints, 
this.context)) {
                 if (log.isDebugEnabled()) {
-                    log.debug(sm.getString("authenticator.userPermissionFail", 
request.getUserPrincipal().getName()));
+                    log.debug(sm.getString("authenticator.userPermissionFail",
+                            request.getUserPrincipal() == null ? "" : 
request.getUserPrincipal().getName()));
                 }
                 /*
                  * ASSERT: AccessControl method has already set the 
appropriate HTTP status code, so we do not have to


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

Reply via email to