diff --git a/jetty-servlet/src/main/java/org/eclipse/jetty/servlet/ServletContextHandler.java b/jetty-servlet/src/main/java/org/eclipse/jetty/servlet/ServletContextHandler.java index e93bfa96fbf..7ce95f9709f 100644 --- a/jetty-servlet/src/main/java/org/eclipse/jetty/servlet/ServletContextHandler.java +++ b/jetty-servlet/src/main/java/org/eclipse/jetty/servlet/ServletContextHandler.java @@ -1299,15 +1299,15 @@ public class ServletContextHandler extends ContextHandler @Override public boolean setInitParameter(String name, String value) { + //since servlet spec 4.0 + Objects.requireNonNull(name); + if (!isStarting()) throw new IllegalStateException(); if (!_enabled) throw new UnsupportedOperationException(); - //since servlet spec 4.0 - Objects.requireNonNull(name); - return super.setInitParameter(name, value); }