You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cxf.apache.org by re...@apache.org on 2024/11/07 17:51:54 UTC

(cxf) branch main updated: Fixes NPE if ClientImpl has been closed/destroyed before the end of invokation (#2140)

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

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


The following commit(s) were added to refs/heads/main by this push:
     new c6c68177d0 Fixes NPE if ClientImpl has been closed/destroyed before the end of invokation (#2140)
c6c68177d0 is described below

commit c6c68177d0434a88ba35e0d9f1423b18c956acb7
Author: Cédric Tabin <ta...@gmail.com>
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
---
 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 d676da9d96..30ac1ba0b3 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();