This is an automated email from the ASF dual-hosted git repository.
markt 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 aada6ead92 StandardSession.java @doWriteObject: adds null-check to
sessionPrincipal before checking if serializable to prevent misleading warning
message logged.
aada6ead92 is described below
commit aada6ead924d102670c5a43be48c14c14c467d74
Author: Yordanov <[email protected]>
AuthorDate: Thu Jul 13 12:04:25 2023 +0200
StandardSession.java @doWriteObject: adds null-check to sessionPrincipal
before checking if serializable to prevent misleading warning message logged.
---
java/org/apache/catalina/session/StandardSession.java | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/java/org/apache/catalina/session/StandardSession.java
b/java/org/apache/catalina/session/StandardSession.java
index 1272484a9d..820d7743e8 100644
--- a/java/org/apache/catalina/session/StandardSession.java
+++ b/java/org/apache/catalina/session/StandardSession.java
@@ -1486,7 +1486,7 @@ public class StandardSession implements HttpSession,
Session, Serializable {
if (getPersistAuthentication()) {
sessionAuthType = getAuthType();
sessionPrincipal = getPrincipal();
- if (!(sessionPrincipal instanceof Serializable)) {
+ if (sessionPrincipal != null && !(sessionPrincipal instanceof
Serializable)) {
sessionPrincipal = null;
manager.getContext().getLogger().warn(sm.getString("standardSession.principalNotSerializable",
id));
}
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]