Author: markt Date: Tue Mar 20 11:07:21 2012 New Revision: 1302837 URL: http://svn.apache.org/viewvc?rev=1302837&view=rev Log: Fix https://issues.apache.org/bugzilla/show_bug.cgi?id=52926 Protect against a NPE if the socket has been closed on another thread
Modified: tomcat/trunk/java/org/apache/tomcat/util/net/NioEndpoint.java Modified: tomcat/trunk/java/org/apache/tomcat/util/net/NioEndpoint.java URL: http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/tomcat/util/net/NioEndpoint.java?rev=1302837&r1=1302836&r2=1302837&view=diff ============================================================================== --- tomcat/trunk/java/org/apache/tomcat/util/net/NioEndpoint.java (original) +++ tomcat/trunk/java/org/apache/tomcat/util/net/NioEndpoint.java Tue Mar 20 11:07:21 2012 @@ -718,6 +718,9 @@ public class NioEndpoint extends Abstrac public boolean processSocket(NioChannel socket, SocketStatus status, boolean dispatch) { try { KeyAttachment attachment = (KeyAttachment)socket.getAttachment(false); + if (attachment == null) { + return false; + } attachment.setCometNotify(false); //will get reset upon next reg SocketProcessor sc = processorCache.poll(); if ( sc == null ) sc = new SocketProcessor(socket,status); --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org