diff --git a/common/src/main/java/io/netty/util/concurrent/NonStickyEventExecutorGroup.java b/common/src/main/java/io/netty/util/concurrent/NonStickyEventExecutorGroup.java index bcc4b82996..a2692f6696 100644 --- a/common/src/main/java/io/netty/util/concurrent/NonStickyEventExecutorGroup.java +++ b/common/src/main/java/io/netty/util/concurrent/NonStickyEventExecutorGroup.java @@ -274,7 +274,7 @@ public final class NonStickyEventExecutorGroup implements EventExecutorGroup { // // The above cases can be distinguished by performing a // compareAndSet(NONE, RUNNING). If it returns "false", it is case 1; otherwise it is case 2. - if (tasks.peek() == null || !state.compareAndSet(NONE, RUNNING)) { + if (tasks.isEmpty() || !state.compareAndSet(NONE, RUNNING)) { return; // done } }