[#2666] Fix possible NPE when try to fullfill connect ChannelPromise

Motivation:

Because of a missing return statement we may produce a NPE when try to fullfill the connect ChannelPromise when it was fullfilled before.

Modification:

Add missing return statement.

Result:

No more NPE.
This commit is contained in:
Norman Maurer 2014-07-18 07:08:30 +02:00
parent dfa00508d9
commit 49d2cfe4ea
2 changed files with 2 additions and 0 deletions

View File

@ -554,6 +554,7 @@ public final class EpollSocketChannel extends AbstractEpollChannel implements So
private void fulfillConnectPromise(ChannelPromise promise, Throwable cause) {
if (promise == null) {
// Closed via cancellation and the promise has been notified already.
return;
}
// Use tryFailure() instead of setFailure() to avoid the race against cancel().

View File

@ -268,6 +268,7 @@ public abstract class AbstractNioChannel extends AbstractChannel {
private void fulfillConnectPromise(ChannelPromise promise, Throwable cause) {
if (promise == null) {
// Closed via cancellation and the promise has been notified already.
return;
}
// Use tryFailure() instead of setFailure() to avoid the race against cancel().