Skip to content

Commit 768a104

Browse files
author
Stephane Landelle
committed
Fix ChannelManager.closeChannel NPE, close AsyncHttpClient#681
1 parent a5c75a4 commit 768a104

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

providers/netty/src/main/java/org/asynchttpclient/providers/netty/channel/ChannelManager.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -307,14 +307,14 @@ public void close() {
307307
}
308308

309309
public void closeChannel(Channel channel) {
310-
removeAll(channel);
311-
Channels.setDiscard(channel);
312310

313311
// The channel may have already been removed if a timeout occurred, and
314312
// this method may be called just after.
315313
if (channel != null) {
316314
LOGGER.debug("Closing Channel {} ", channel);
317315
try {
316+
removeAll(channel);
317+
Channels.setDiscard(channel);
318318
channel.close();
319319
} catch (Throwable t) {
320320
LOGGER.debug("Error closing a connection", t);

0 commit comments

Comments
 (0)