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 b22721e3fa Avoid unlikely NPE in debug log
b22721e3fa is described below
commit b22721e3fa5ad0d304c70e1784e68900fdf8e87f
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]