From 3f8a830963eb9676b91c2a24c17ad4f8331069d1 Mon Sep 17 00:00:00 2001 From: Andrew Cox Date: Tue, 2 Apr 2013 21:18:19 -0700 Subject: [PATCH] Fix DefaultChannelPipeline.first() so that it returns null when only the sentinel handlers remain (this is how DefaultChannelPipeline.last() works already) --- .../src/main/java/io/netty/channel/DefaultChannelPipeline.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/transport/src/main/java/io/netty/channel/DefaultChannelPipeline.java b/transport/src/main/java/io/netty/channel/DefaultChannelPipeline.java index 3efe734423..6697f13fff 100755 --- a/transport/src/main/java/io/netty/channel/DefaultChannelPipeline.java +++ b/transport/src/main/java/io/netty/channel/DefaultChannelPipeline.java @@ -751,7 +751,7 @@ final class DefaultChannelPipeline implements ChannelPipeline { @Override public ChannelHandler first() { DefaultChannelHandlerContext first = head.next; - if (first == null) { + if (first == head) { return null; } return first.handler();