git-svn-id: https://svn.apache.org/repos/asf/tomcat/tc6.0.x/trunk@519168
13f79535-47bb-0310-9956-
ffa450edef68
}
} 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);
}