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 55476b7f48ce..69bade58dd68 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 @@ private void externalAbort(Throwable failure, Promise promise) } } - 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 @@ protected void onCompleteFailure(Throwable x) } failRequest(x); - internalAbort(exchange, x); + internalAbort(x); Promise promise = abort; if (promise != null)