From 3813f09616a9bed1cfc107a79e4090645256590c Mon Sep 17 00:00:00 2001 From: fhanik Date: Fri, 13 Apr 2007 15:39:44 +0000 Subject: [PATCH] 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 --- java/org/apache/tomcat/util/net/NioEndpoint.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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); -- 2.11.0