[#1399] DefaultChannelHandlerPipeline.firstContext() should return null if no user handlers are in in the pipeline
This commit is contained in:
parent
f7931af704
commit
89f1f3f4d1
@ -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;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user