Skip to content

Commit 3733a4b

Browse files
author
Nandika
committed
Fix for Null pointer exception, socket holder is null
1 parent a89e494 commit 3733a4b

File tree

1 file changed

+11
-9
lines changed

1 file changed

+11
-9
lines changed

modules/transport/http/src/main/java/org/apache/axis2/transport/http/server/AxisHttpConnectionImpl.java

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -163,16 +163,18 @@ public void close() throws IOException {
163163
}
164164

165165
final SocketHolder socketHolder = this.socketHolderRef.getAndSet(null);
166-
final Socket socket = socketHolder.getSocket();
167-
try {
168-
socket.shutdownOutput();
169-
} catch (IOException ignore) {
170-
}
171-
try {
172-
socket.shutdownInput();
173-
} catch (IOException ignore) {
166+
if(socketHolder != null) {
167+
final Socket socket = socketHolder.getSocket();
168+
try {
169+
socket.shutdownOutput();
170+
} catch (IOException ignore) {
171+
}
172+
try {
173+
socket.shutdownInput();
174+
} catch (IOException ignore) {
175+
}
176+
socket.close();
174177
}
175-
socket.close();
176178
}
177179

178180
public boolean isOpen() {

0 commit comments

Comments
 (0)