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

reta pushed a commit to branch 3.6.x-fixes
in repository https://gitbox.apache.org/repos/asf/cxf.git

commit 758ee408db4db6c03ff5bf54b06f3a49f3909301
Author: Cédric Tabin <[email protected]>
AuthorDate: Thu Nov 7 18:51:48 2024 +0100

    Fixes NPE if ClientImpl has been closed/destroyed before the end of 
invokation (#2140)
    
    * Fixes NPE if ClientImpl has been closed/destroyed before the end of the 
invokation
    
    * Guard setResponseContext
    
    * Fixes checkstyle
    
    (cherry picked from commit c6c68177d0434a88ba35e0d9f1423b18c956acb7)
    (cherry picked from commit 2298ca78b6713ec0b28cc70bd3bf23ea5b432266)
---
 core/src/main/java/org/apache/cxf/endpoint/ClientImpl.java | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/core/src/main/java/org/apache/cxf/endpoint/ClientImpl.java 
b/core/src/main/java/org/apache/cxf/endpoint/ClientImpl.java
index 2dea60e2ba..72097949a4 100644
--- a/core/src/main/java/org/apache/cxf/endpoint/ClientImpl.java
+++ b/core/src/main/java/org/apache/cxf/endpoint/ClientImpl.java
@@ -543,7 +543,9 @@ public class ClientImpl
                 Integer responseCode = 
(Integer)exchange.get(Message.RESPONSE_CODE);
                 resContext.put(MessageContext.HTTP_RESPONSE_CODE, 
responseCode);
                 resContext.put(org.apache.cxf.message.Message.RESPONSE_CODE, 
responseCode);
-                setResponseContext(resContext);
+                if (null != responseContext) {
+                    setResponseContext(resContext);
+                }
             }
             if (origLoader != null) {
                 origLoader.reset();

Reply via email to