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

nandika pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/axis-axis2-java-core.git


The following commit(s) were added to refs/heads/master by this push:
     new 3733a4b4f6 Fix for Null pointer exception, socket holder is null
3733a4b4f6 is described below

commit 3733a4b4f613ba874476371697069b317d82f9a7
Author: Nandika <nand...@apache.org>
AuthorDate: Sat Apr 19 14:23:28 2025 +0530

    Fix for Null pointer exception, socket holder is null
---
 .../http/server/AxisHttpConnectionImpl.java          | 20 +++++++++++---------
 1 file changed, 11 insertions(+), 9 deletions(-)

diff --git 
a/modules/transport/http/src/main/java/org/apache/axis2/transport/http/server/AxisHttpConnectionImpl.java
 
b/modules/transport/http/src/main/java/org/apache/axis2/transport/http/server/AxisHttpConnectionImpl.java
index a1bc7c22cc..620fc22b4b 100644
--- 
a/modules/transport/http/src/main/java/org/apache/axis2/transport/http/server/AxisHttpConnectionImpl.java
+++ 
b/modules/transport/http/src/main/java/org/apache/axis2/transport/http/server/AxisHttpConnectionImpl.java
@@ -163,16 +163,18 @@ public class AxisHttpConnectionImpl implements 
AxisHttpConnection {
        }       
 
         final SocketHolder socketHolder = this.socketHolderRef.getAndSet(null);
-        final Socket socket = socketHolder.getSocket();
-        try {
-            socket.shutdownOutput();
-        } catch (IOException ignore) {
-        }
-        try {
-            socket.shutdownInput();
-        } catch (IOException ignore) {
+        if(socketHolder != null) {
+            final Socket socket = socketHolder.getSocket();
+            try {
+                socket.shutdownOutput();
+            } catch (IOException ignore) {
+            }
+            try {
+                socket.shutdownInput();
+            } catch (IOException ignore) {
+            }
+            socket.close();
         }
-        socket.close();
     }
 
     public boolean isOpen() {

Reply via email to