diff --git a/jetty-core/jetty-client/src/main/java/org/eclipse/jetty/client/transport/HttpSender.java b/jetty-core/jetty-client/src/main/java/org/eclipse/jetty/client/transport/HttpSender.java index 55476b7f48c..69bade58dd6 100644 --- a/jetty-core/jetty-client/src/main/java/org/eclipse/jetty/client/transport/HttpSender.java +++ b/jetty-core/jetty-client/src/main/java/org/eclipse/jetty/client/transport/HttpSender.java @@ -386,8 +386,11 @@ public abstract class HttpSender } } - private void internalAbort(HttpExchange exchange, Throwable failure) + private void internalAbort(Throwable failure) { + HttpExchange exchange = getHttpExchange(); + if (exchange == null) + return; anyToFailure(failure); abortRequest(exchange); } @@ -626,7 +629,7 @@ public abstract class HttpSender } failRequest(x); - internalAbort(exchange, x); + internalAbort(x); Promise promise = abort; if (promise != null)