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 d359c61700 Avoid unlikely NPE in debug log
d359c61700 is described below

commit d359c61700c96c17a37654c43ecdb52c188bc401
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 a5c650373f..b1bdf5ae67 100644
--- a/java/org/apache/catalina/authenticator/AuthenticatorBase.java
+++ b/java/org/apache/catalina/authenticator/AuthenticatorBase.java
@@ -634,7 +634,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