You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by si...@apache.org on 2019/10/11 12:49:23 UTC

[camel] branch camel-2.x updated: CAMEL-14058 NPE for one-way requests with cookie handling

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

siano pushed a commit to branch camel-2.x
in repository https://gitbox.apache.org/repos/asf/camel.git


The following commit(s) were added to refs/heads/camel-2.x by this push:
     new 77c52af  CAMEL-14058 NPE for one-way requests with cookie handling
77c52af is described below

commit 77c52afefee687313f02a4bbb2dae0169a6278ab
Author: Stephan Siano <st...@sap.com>
AuthorDate: Fri Oct 11 14:27:12 2019 +0200

    CAMEL-14058 NPE for one-way requests with cookie handling
---
 .../main/java/org/apache/camel/component/cxf/CxfClientCallback.java   | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/CxfClientCallback.java b/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/CxfClientCallback.java
index b2810c5..66e549b 100644
--- a/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/CxfClientCallback.java
+++ b/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/CxfClientCallback.java
@@ -57,7 +57,7 @@ public class CxfClientCallback extends ClientCallback {
             super.handleResponse(ctx, res);            
         } finally {
             // add cookies to the cookie store
-            if (endpoint.getCookieHandler() != null) {
+            if (endpoint.getCookieHandler() != null && cxfExchange.getInMessage() != null) {
                 try {
                     Map<String, List<String>> cxfHeaders = CastUtils.cast((Map<?, ?>)cxfExchange.getInMessage().get(Message.PROTOCOL_HEADERS));
                     endpoint.getCookieHandler().storeCookies(camelExchange, endpoint.getRequestUri(camelExchange), cxfHeaders);
@@ -98,7 +98,7 @@ public class CxfClientCallback extends ClientCallback {
             }
         } finally {
             // add cookies to the cookie store
-            if (endpoint.getCookieHandler() != null) {
+            if (endpoint.getCookieHandler() != null && cxfExchange.getInMessage() != null) {
                 try {
                     Map<String, List<String>> cxfHeaders = CastUtils.cast((Map<?, ?>)cxfExchange.getInMessage().get(Message.PROTOCOL_HEADERS));
                     endpoint.getCookieHandler().storeCookies(camelExchange, endpoint.getRequestUri(camelExchange), cxfHeaders);