Skip to content

Commit e9e68ab

Browse files
author
Stephane Landelle
committed
Actually, the channel is never null
1 parent d837206 commit e9e68ab

File tree

1 file changed

+8
-12
lines changed

1 file changed

+8
-12
lines changed

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

Lines changed: 8 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -308,19 +308,15 @@ public void close() {
308308

309309
public void closeChannel(Channel channel) {
310310

311-
// The channel may have already been removed if a timeout occurred, and
312-
// this method may be called just after.
313-
if (channel != null) {
314-
LOGGER.debug("Closing Channel {} ", channel);
315-
try {
316-
removeAll(channel);
317-
Channels.setDiscard(channel);
318-
channel.close();
319-
} catch (Throwable t) {
320-
LOGGER.debug("Error closing a connection", t);
321-
}
322-
openChannels.remove(channel);
311+
LOGGER.debug("Closing Channel {} ", channel);
312+
try {
313+
removeAll(channel);
314+
Channels.setDiscard(channel);
315+
channel.close();
316+
} catch (Throwable t) {
317+
LOGGER.debug("Error closing a connection", t);
323318
}
319+
openChannels.remove(channel);
324320
}
325321

326322
public void abortChannelPreemption(String poolKey) {

0 commit comments

Comments
 (0)