cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dk...@apache.org
Subject [4/6] cxf git commit: [CXF-6092] Add a couple NPE guards
Date Fri, 07 Nov 2014 19:59:44 GMT
[CXF-6092] Add a couple NPE guards


Project: http://git-wip-us.apache.org/repos/asf/cxf/repo
Commit: http://git-wip-us.apache.org/repos/asf/cxf/commit/1bde7c9a
Tree: http://git-wip-us.apache.org/repos/asf/cxf/tree/1bde7c9a
Diff: http://git-wip-us.apache.org/repos/asf/cxf/diff/1bde7c9a

Branch: refs/heads/2.7.x-fixes
Commit: 1bde7c9a31a473bf73ad246c2f3d3996cae7d09b
Parents: d951a5d
Author: Daniel Kulp <dkulp@apache.org>
Authored: Fri Nov 7 13:25:52 2014 -0500
Committer: Daniel Kulp <dkulp@apache.org>
Committed: Fri Nov 7 14:44:06 2014 -0500

----------------------------------------------------------------------
 api/src/main/java/org/apache/cxf/endpoint/ClientImpl.java | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cxf/blob/1bde7c9a/api/src/main/java/org/apache/cxf/endpoint/ClientImpl.java
----------------------------------------------------------------------
diff --git a/api/src/main/java/org/apache/cxf/endpoint/ClientImpl.java b/api/src/main/java/org/apache/cxf/endpoint/ClientImpl.java
index 4971677..bab6091 100644
--- a/api/src/main/java/org/apache/cxf/endpoint/ClientImpl.java
+++ b/api/src/main/java/org/apache/cxf/endpoint/ClientImpl.java
@@ -381,7 +381,9 @@ public class ClientImpl
         try {
             return invoke(oi, params, context, exchange);
         } finally {
-            responseContext.put(Thread.currentThread(), resp);
+            if (responseContext != null) {
+                responseContext.put(Thread.currentThread(), resp);
+            }
         }
     }
     public Object[] invoke(BindingOperationInfo oi,
@@ -392,7 +394,7 @@ public class ClientImpl
         } finally {
             if (context != null) {
                 Map<String, Object> resp = CastUtils.cast((Map<?, ?>)context.get(RESPONSE_CONTEXT));
-                if (resp != null) {
+                if (resp != null && responseContext != null) {
                     responseContext.put(Thread.currentThread(), resp);
                 }
             }
@@ -858,7 +860,7 @@ public class ClientImpl
                                                                 .getOutMessage()
                                                                 .get(Message.INVOCATION_CONTEXT));
                 resCtx = CastUtils.cast((Map<?, ?>)resCtx.get(RESPONSE_CONTEXT));
-                if (resCtx != null) {
+                if (resCtx != null && responseContext != null) {
                     responseContext.put(Thread.currentThread(), resCtx);
                 }
                 try {


Mime
View raw message