diff --git a/activemq-core/src/main/java/org/apache/activemq/transport/nio/SelectorSelection.java b/activemq-core/src/main/java/org/apache/activemq/transport/nio/SelectorSelection.java index 1e8b9b6032..681b5df77c 100644 --- a/activemq-core/src/main/java/org/apache/activemq/transport/nio/SelectorSelection.java +++ b/activemq-core/src/main/java/org/apache/activemq/transport/nio/SelectorSelection.java @@ -49,7 +49,9 @@ public final class SelectorSelection { } public void disable() { - key.interestOps(0); + if (key.isValid()) { + key.interestOps(0); + } } public void close() {