From abb5ae881257788d3de84801e3f7c2228961fc37 Mon Sep 17 00:00:00 2001 From: Lachlan Roberts Date: Tue, 1 Sep 2020 10:03:18 +1000 Subject: [PATCH] HttpExchange could be null during parse() Signed-off-by: Lachlan Roberts --- .../org/eclipse/jetty/client/http/HttpReceiverOverHTTP.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/jetty-client/src/main/java/org/eclipse/jetty/client/http/HttpReceiverOverHTTP.java b/jetty-client/src/main/java/org/eclipse/jetty/client/http/HttpReceiverOverHTTP.java index 57b15e614fc..9675cfa11be 100644 --- a/jetty-client/src/main/java/org/eclipse/jetty/client/http/HttpReceiverOverHTTP.java +++ b/jetty-client/src/main/java/org/eclipse/jetty/client/http/HttpReceiverOverHTTP.java @@ -235,7 +235,8 @@ public class HttpReceiverOverHTTP extends HttpReceiver implements HttpParser.Res if (complete) { - if (getHttpExchange().getResponse().getStatus() == HttpStatus.SWITCHING_PROTOCOLS_101) + HttpExchange httpExchange = getHttpExchange(); + if (httpExchange != null && httpExchange.getResponse().getStatus() == HttpStatus.SWITCHING_PROTOCOLS_101) return true; if (LOG.isDebugEnabled())