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:21:11 -07:00
parent 6c0429391e
commit ba84e44660

View File

@ -364,6 +364,10 @@ public class DefaultChannelFuture implements ChannelFuture {
}
public boolean setFailure(Throwable cause) {
if (cause == null) {
throw new NullPointerException("cause");
}
synchronized (this) {
// Allow only once.
if (done) {