fixed minor bug introduced recently
authorfhanik <fhanik@13f79535-47bb-0310-9956-ffa450edef68>
Fri, 16 Mar 2007 22:38:19 +0000 (22:38 +0000)
committerfhanik <fhanik@13f79535-47bb-0310-9956-ffa450edef68>
Fri, 16 Mar 2007 22:38:19 +0000 (22:38 +0000)
git-svn-id: https://svn.apache.org/repos/asf/tomcat/tc6.0.x/trunk@519168 13f79535-47bb-0310-9956-ffa450edef68

java/org/apache/tomcat/util/net/NioEndpoint.java

index 48476ae..7d71829 100644 (file)
@@ -1145,11 +1145,11 @@ public class NioEndpoint {
                 }
             } else {
                 final SelectionKey key = socket.getIOChannel().keyFor(socket.getPoller().getSelector());
-                final KeyAttachment att = (KeyAttachment) key.attachment();
-                //we are registering the key to start with, reset the fairness counter.
-                att.setFairness(0);
                 try {
                     if (key != null) {
+                        final KeyAttachment att = (KeyAttachment) key.attachment();
+                        //we are registering the key to start with, reset the fairness counter.
+                        att.setFairness(0);
                         key.interestOps(interestOps);
                         att.interestOps(interestOps);
                     }