diff --git a/jetty-io/src/main/java/org/eclipse/jetty/io/SelectorManager.java b/jetty-io/src/main/java/org/eclipse/jetty/io/SelectorManager.java index ad35aa2f388..fab73091622 100644 --- a/jetty-io/src/main/java/org/eclipse/jetty/io/SelectorManager.java +++ b/jetty-io/src/main/java/org/eclipse/jetty/io/SelectorManager.java @@ -148,14 +148,14 @@ public abstract class SelectorManager extends ContainerLifeCycle implements Dump public int getTotalKeys() { int keys = 0; - for (final ManagedSelector selector : _selectors) + for (ManagedSelector selector : _selectors) { - keys += selector.getTotalKeys(); + if (selector != null) + keys += selector.getTotalKeys(); } return keys; } - /** * @return the number of selectors in use */