Skip to content

Commit c1d8e1a

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

File tree

1 file changed

+8
-10
lines changed

1 file changed

+8
-10
lines changed

src/main/java/com/ning/http/client/providers/netty/channel/ChannelManager.java

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -317,17 +317,15 @@ public void close() {
317317
public void closeChannel(Channel channel) {
318318

319319
// The channel may have already been removed from the future if a timeout occurred, and this method may be called just after.
320-
if (channel != null) {
321-
LOGGER.debug("Closing Channel {} ", channel);
322-
try {
323-
removeAll(channel);
324-
Channels.setDiscard(channel);
325-
channel.close();
326-
} catch (Throwable t) {
327-
LOGGER.debug("Error closing a connection", t);
328-
}
329-
openChannels.remove(channel);
320+
LOGGER.debug("Closing Channel {} ", channel);
321+
try {
322+
removeAll(channel);
323+
Channels.setDiscard(channel);
324+
channel.close();
325+
} catch (Throwable t) {
326+
LOGGER.debug("Error closing a connection", t);
330327
}
328+
openChannels.remove(channel);
331329
}
332330

333331
public void abortChannelPreemption(String poolKey) {

0 commit comments

Comments
 (0)