Return-Path: X-Original-To: apmail-cxf-commits-archive@www.apache.org Delivered-To: apmail-cxf-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 57EBE17EB4 for ; Fri, 7 Nov 2014 19:12:49 +0000 (UTC) Received: (qmail 37560 invoked by uid 500); 7 Nov 2014 19:12:49 -0000 Delivered-To: apmail-cxf-commits-archive@cxf.apache.org Received: (qmail 37403 invoked by uid 500); 7 Nov 2014 19:12:49 -0000 Mailing-List: contact commits-help@cxf.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@cxf.apache.org Delivered-To: mailing list commits@cxf.apache.org Received: (qmail 36875 invoked by uid 99); 7 Nov 2014 19:12:48 -0000 Received: from tyr.zones.apache.org (HELO tyr.zones.apache.org) (140.211.11.114) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 07 Nov 2014 19:12:48 +0000 Received: by tyr.zones.apache.org (Postfix, from userid 65534) id 8476898BCE2; Fri, 7 Nov 2014 19:12:48 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: dkulp@apache.org To: commits@cxf.apache.org Date: Fri, 07 Nov 2014 19:13:01 -0000 Message-Id: In-Reply-To: References: X-Mailer: ASF-Git Admin Mailer Subject: [14/15] cxf git commit: [CXF-6092] Add a couple NPE guards [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/2d246e70 Tree: http://git-wip-us.apache.org/repos/asf/cxf/tree/2d246e70 Diff: http://git-wip-us.apache.org/repos/asf/cxf/diff/2d246e70 Branch: refs/heads/3.0.x-fixes Commit: 2d246e708ce9d586477bed79db384e8876f7170f Parents: 1f860a9 Author: Daniel Kulp Authored: Fri Nov 7 13:25:52 2014 -0500 Committer: Daniel Kulp Committed: Fri Nov 7 13:58:49 2014 -0500 ---------------------------------------------------------------------- core/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/2d246e70/core/src/main/java/org/apache/cxf/endpoint/ClientImpl.java ---------------------------------------------------------------------- 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 9114c66..775170c 100644 --- a/core/src/main/java/org/apache/cxf/endpoint/ClientImpl.java +++ b/core/src/main/java/org/apache/cxf/endpoint/ClientImpl.java @@ -325,7 +325,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, @@ -336,7 +338,7 @@ public class ClientImpl } finally { if (context != null) { Map resp = CastUtils.cast((Map)context.get(RESPONSE_CONTEXT)); - if (resp != null) { + if (resp != null && responseContext != null) { responseContext.put(Thread.currentThread(), resp); } } @@ -811,7 +813,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 {