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 ad35aa2f388b..fab730916228 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 @@ protected void execute(Runnable task) 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 */