This is an automated email from the ASF dual-hosted git repository.

reta pushed a commit to branch fix.npe.2
in repository https://gitbox.apache.org/repos/asf/cxf.git

commit 0557854282e407d709859d3580f8034cebc95c44
Author: Andriy Redko <[email protected]>
AuthorDate: Fri Nov 28 18:06:59 2025 -0500

    Fix org.apache.cxf.transport.http.asyncclient.AsyncHTTPConduitTest throwing 
java.lang.NullPointerException
---
 .../src/main/java/org/apache/cxf/transport/http/HTTPConduit.java     | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git 
a/rt/transports/http/src/main/java/org/apache/cxf/transport/http/HTTPConduit.java
 
b/rt/transports/http/src/main/java/org/apache/cxf/transport/http/HTTPConduit.java
index 7b185d5931..dcbcc8fbe5 100644
--- 
a/rt/transports/http/src/main/java/org/apache/cxf/transport/http/HTTPConduit.java
+++ 
b/rt/transports/http/src/main/java/org/apache/cxf/transport/http/HTTPConduit.java
@@ -1733,8 +1733,9 @@ public abstract class HTTPConduit
                 //not going to be resending or anything, clear out the stuff 
in the out message
                 //to free memory
                 outMessage.removeContent(OutputStream.class);
-                if (cachingForRetransmission && cachedStream != null) {
-                    cachedStream.close();
+                final CacheAndWriteOutputStream stream = cachedStream;
+                if (cachingForRetransmission && stream != null) {
+                    stream.close();
                 }
                 cachedStream = null;
             }

Reply via email to