[#739] Potential NullPointException without checking the initialCtx's status

This commit is contained in:
Evans Yang 2012-11-15 16:42:21 +08:00 committed by Norman Maurer
parent d28eca7138
commit 37d04c26a8

View File

@ -892,7 +892,7 @@ public class DefaultChannelPipeline implements ChannelPipeline {
final Thread currentThread = Thread.currentThread();
for (;;) {
if (ctx == null) {
if (initialCtx.next != null) {
if (initialCtx != null && initialCtx.next != null) {
throw new NoSuchBufferException(String.format(
"the handler '%s' could not find a %s whose outbound buffer is %s.",
initialCtx.next.name(), ChannelOutboundHandler.class.getSimpleName(),