[#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:
parent
4db6c65534
commit
89593a719b
@ -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().
|
||||
|
@ -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().
|
||||
|
Loading…
Reference in New Issue
Block a user