From: fhanik Date: Fri, 13 Apr 2007 15:39:44 +0000 (+0000) Subject: Prevent NPE on a key that was cancelled by the poller X-Git-Url: https://git.internetallee.de/?a=commitdiff_plain;h=3813f09616a9bed1cfc107a79e4090645256590c;p=tomcat7.0 Prevent NPE on a key that was cancelled by the poller git-svn-id: https://svn.apache.org/repos/asf/tomcat/tc6.0.x/trunk@528528 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/java/org/apache/tomcat/util/net/NioEndpoint.java b/java/org/apache/tomcat/util/net/NioEndpoint.java index a8664e63a..1bd8a1eaa 100644 --- a/java/org/apache/tomcat/util/net/NioEndpoint.java +++ b/java/org/apache/tomcat/util/net/NioEndpoint.java @@ -1862,7 +1862,7 @@ public class NioEndpoint { SelectionKey key = socket.getIOChannel().keyFor(socket.getPoller().getSelector()); int handshake = -1; try { - handshake = socket.handshake(key.isReadable(), key.isWritable()); + if (key!=null) handshake = socket.handshake(key.isReadable(), key.isWritable()); }catch ( IOException x ) { handshake = -1; if ( log.isDebugEnabled() ) log.debug("Error during SSL handshake",x);