Fix DefaultChannelPipeline.first() so that it returns null when only the sentinel handlers remain (this is how DefaultChannelPipeline.last() works already)

This commit is contained in:
Andrew Cox 2013-04-02 21:18:19 -07:00 committed by Norman Maurer
parent 2ffa083d3c
commit 3f8a830963

View File

@ -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();