diff --git a/jetty-http2/http2-server/src/main/java/org/eclipse/jetty/http2/server/HttpChannelOverHTTP2.java b/jetty-http2/http2-server/src/main/java/org/eclipse/jetty/http2/server/HttpChannelOverHTTP2.java index 6d0e042b276..ec3e49c2493 100644 --- a/jetty-http2/http2-server/src/main/java/org/eclipse/jetty/http2/server/HttpChannelOverHTTP2.java +++ b/jetty-http2/http2-server/src/main/java/org/eclipse/jetty/http2/server/HttpChannelOverHTTP2.java @@ -280,6 +280,10 @@ public class HttpChannelOverHTTP2 extends HttpChannel @Override public String toString() { - return String.format("%s#%d", super.toString(), getStream().getId()); + IStream stream = getStream(); + long streamId = -1; + if (stream != null) + streamId = stream.getId(); + return String.format("%s#%d", super.toString(), getStream() == null ? -1 : streamId); } }