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

gnodet pushed a commit to branch fix/CXF-9204-failover-npe
in repository https://gitbox.apache.org/repos/asf/cxf.git

commit ac40dbcbb1cf6182c70eb3a9264d7b30abae87ac
Author: Guillaume Nodet <[email protected]>
AuthorDate: Tue Mar 10 20:55:52 2026 +0100

    Remove defensive null check for inMsg in ClientImpl fault observer
    
    Per review feedback: with the root cause fix in FailoverTargetSelector
    (unconditional exception restoration), inMsg should always be available
    in this code path. Keep it clean.
---
 core/src/main/java/org/apache/cxf/endpoint/ClientImpl.java | 12 +++++-------
 1 file changed, 5 insertions(+), 7 deletions(-)

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 49479403f2..30ac1ba0b3 100644
--- a/core/src/main/java/org/apache/cxf/endpoint/ClientImpl.java
+++ b/core/src/main/java/org/apache/cxf/endpoint/ClientImpl.java
@@ -511,13 +511,11 @@ public class ClientImpl
                             if (message.getContent(Exception.class) == null) {
                                 // handle the right response
                                 Message inMsg = 
message.getExchange().getInMessage();
-                                if (inMsg != null) {
-                                    Map<String, Object> ctx = 
responseContext.get(Thread.currentThread());
-                                    List<Object> resList = 
CastUtils.cast(inMsg.getContent(List.class));
-                                    Object[] result = resList == null ? null : 
resList.toArray();
-                                    callback.handleResponse(ctx, result);
-                                    return;
-                                }
+                                Map<String, Object> ctx = 
responseContext.get(Thread.currentThread());
+                                List<Object> resList = 
CastUtils.cast(inMsg.getContent(List.class));
+                                Object[] result = resList == null ? null : 
resList.toArray();
+                                callback.handleResponse(ctx, result);
+                                return;
                             }
                         }
                         outFaultObserver.onMessage(message);

Reply via email to