Skip to content

Commit 6612f2d

Browse files
committed
Port f03b5f9
1 parent 0eda02a commit 6612f2d

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

providers/netty/src/main/java/org/asynchttpclient/providers/netty/handler/WebSocketProtocol.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -200,7 +200,8 @@ public void onClose(ChannelHandlerContext ctx) {
200200
NettyWebSocket webSocket = NettyWebSocket.class.cast(h.onCompleted());
201201

202202
// FIXME How could this test not succeed, we just checked above that attribute is a NettyResponseFuture????
203-
if (attribute != DiscardEvent.INSTANCE)
203+
LOGGER.trace("Connection was closed abnormally (that is, with no close frame being sent).");
204+
if (attribute != DiscardEvent.INSTANCE && webSocket != null)
204205
webSocket.close(1006, "Connection was closed abnormally (that is, with no close frame being sent).");
205206
} catch (Throwable t) {
206207
LOGGER.error("onError", t);

0 commit comments

Comments
 (0)