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:41:59 UTC
[camel] branch master 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 master
in repository https://gitbox.apache.org/repos/asf/camel.git
The following commit(s) were added to refs/heads/master by this push:
new ee42ef0 CAMEL-14058 NPE for one-way requests with cookie handling
ee42ef0 is described below
commit ee42ef073588dddfc9a72463a71f5aae31e79674
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 742e16f..d8d211a 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
@@ -58,7 +58,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);
@@ -100,7 +100,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);