[#1399] DefaultChannelHandlerPipeline.firstContext() should return null if no user handlers are in in the pipeline

This commit is contained in:
Norman Maurer 2013-05-27 15:45:34 +02:00
parent f7931af704
commit 89f1f3f4d1

View File

@ -586,8 +586,8 @@ final class DefaultChannelPipeline implements ChannelPipeline {
@Override
public ChannelHandler first() {
DefaultChannelHandlerContext first = head.next;
if (first == head) {
ChannelHandlerContext first = firstContext();
if (first == null) {
return null;
}
return first.handler();
@ -595,6 +595,10 @@ final class DefaultChannelPipeline implements ChannelPipeline {
@Override
public ChannelHandlerContext firstContext() {
DefaultChannelHandlerContext first = head.next;
if (first == head) {
return null;
}
return head.next;
}