This is an automated email from the ASF dual-hosted git repository.
markt-asf 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 7c64285daa Fix possible NPEs
7c64285daa is described below
commit 7c64285daac285806937cf75e6d77d704fb8c2f2
Author: Mark Thomas <[email protected]>
AuthorDate: Wed Jun 24 18:37:35 2026 +0100
Fix possible NPEs
---
.../apache/catalina/ha/tcp/ReplicationValve.java | 21 ++++++++++++---------
1 file changed, 12 insertions(+), 9 deletions(-)
diff --git a/java/org/apache/catalina/ha/tcp/ReplicationValve.java
b/java/org/apache/catalina/ha/tcp/ReplicationValve.java
index 7b66e78f4c..34d285c25c 100644
--- a/java/org/apache/catalina/ha/tcp/ReplicationValve.java
+++ b/java/org/apache/catalina/ha/tcp/ReplicationValve.java
@@ -298,8 +298,8 @@ public class ReplicationValve extends ValveBase implements
ClusterValve {
// --------------------------------------------------------- Public Methods
/**
- * Register a cross-context session for replication. The session is added
to
- * the current thread's cross-context session list if it is not already
present.
+ * Register a cross-context session for replication. The session is added
to the current thread's cross-context
+ * session list if it is not already present.
*
* @param session the cross-context session to register
*/
@@ -399,10 +399,10 @@ public class ReplicationValve extends ValveBase
implements ClusterValve {
/**
* Send a replication message for the given request.
*
- * @param request the request
- * @param totalstart the start time
+ * @param request the request
+ * @param totalstart the start time
* @param isCrossContext {@code true} if cross-context
- * @param isAsync {@code true} if async
+ * @param isAsync {@code true} if async
* @param clusterManager the cluster manager
*/
protected void sendReplicationMessage(Request request, long totalstart,
boolean isCrossContext, boolean isAsync,
@@ -620,16 +620,19 @@ public class ReplicationValve extends ValveBase
implements ClusterValve {
if (session instanceof ClusterSession) {
ClusterSession cses = (ClusterSession) session;
if (log.isDebugEnabled()) {
-
log.debug(sm.getString("ReplicationValve.session.indicator",
request.getContext().getName(), id,
- primaryIndicatorName,
Boolean.valueOf(cses.isPrimarySession())));
+
log.debug(sm.getString("ReplicationValve.session.indicator",
+ ctx == null ? "null Context" : ctx.getPath(), id,
primaryIndicatorName,
+ Boolean.valueOf(cses.isPrimarySession())));
}
request.setAttribute(primaryIndicatorName,
cses.isPrimarySession() ? Boolean.TRUE : Boolean.FALSE);
} else {
if (log.isDebugEnabled()) {
if (session != null) {
-
log.debug(sm.getString("ReplicationValve.session.found",
request.getContext().getName(), id));
+
log.debug(sm.getString("ReplicationValve.session.found",
+ ctx == null ? "null Context" : ctx.getPath(),
id));
} else {
-
log.debug(sm.getString("ReplicationValve.session.invalid",
request.getContext().getName(), id));
+
log.debug(sm.getString("ReplicationValve.session.invalid",
+ ctx == null ? "null Context" : ctx.getPath(),
id));
}
}
}
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]