Fix race condition causing an NPE in tlschannel
@@ -121,7 +121,9 @@ public class AsynchronousTlsChannelGroup {
public void close() {
doCancelRead(this, null);
doCancelWrite(this, null);
+ if (key != null) {
key.cancel();
+ }
currentRegistrations.getAndDecrement();
/*
* Actual de-registration from the selector will happen asynchronously.
