This is an automated email from the ASF dual-hosted git repository.

markt-asf 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 2047cfb0c1 Fix possible NPE
2047cfb0c1 is described below

commit 2047cfb0c1a34335a083eefd546e33e36f478af1
Author: Mark Thomas <[email protected]>
AuthorDate: Thu Sep 3 12:22:47 2026 +0100

    Fix possible NPE
---
 java/org/apache/tomcat/websocket/WsRemoteEndpointImplBase.java | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/java/org/apache/tomcat/websocket/WsRemoteEndpointImplBase.java 
b/java/org/apache/tomcat/websocket/WsRemoteEndpointImplBase.java
index 84a2d3ae4b..aeb08b36f1 100644
--- a/java/org/apache/tomcat/websocket/WsRemoteEndpointImplBase.java
+++ b/java/org/apache/tomcat/websocket/WsRemoteEndpointImplBase.java
@@ -471,7 +471,9 @@ public abstract class WsRemoteEndpointImplBase implements 
RemoteEndpoint {
         // that no message parts will be returned. If this is the case the
         // trigger the supplied SendHandler
         if (messageParts.isEmpty()) {
-            handler.onResult(new SendResult(getSession()));
+            if (handler != null) {
+                handler.onResult(new SendResult(getSession()));
+            }
             return;
         }
 


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to