This is an automated email from the ASF dual-hosted git repository.
rmaucher pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/tomcat.git
The following commit(s) were added to refs/heads/main by this push:
new 974e0e897c Avoid unlikely NPE in debug log
974e0e897c is described below
commit 974e0e897c1b755354052ba15e5eec1da5db26bc
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]