Fix a bug where ChannelFuture.setFailure(null) doesn't fail

Motivation:

We forgot to do a null check on the cause parameter of
ChannelFuture.setFailure(cause)

Modifications:

Add a null check

Result:

Fixed issue: #2728
This commit is contained in:
Trustin Lee 2014-08-05 11:23:28 -07:00
parent 869687bd71
commit 8fce6316ad

View File

@ -471,6 +471,10 @@ public class DefaultPromise<V> extends AbstractFuture<V> implements Promise<V> {
}
private boolean setFailure0(Throwable cause) {
if (cause == null) {
throw new NullPointerException("cause");
}
if (isDone()) {
return false;
}