You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by da...@apache.org on 2019/06/05 09:39:29 UTC

[camel] 04/07: Fixed potential NPE

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

davsclaus pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/camel.git

commit c339fa9c90643ce345060eff3ebee664114caade
Author: Claus Ibsen <cl...@gmail.com>
AuthorDate: Wed Jun 5 11:17:38 2019 +0200

    Fixed potential NPE
---
 .../main/java/org/apache/camel/component/cxf/DefaultCxfBinding.java | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/DefaultCxfBinding.java b/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/DefaultCxfBinding.java
index ea7222f..b6b9348 100644
--- a/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/DefaultCxfBinding.java
+++ b/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/DefaultCxfBinding.java
@@ -684,8 +684,10 @@ public class DefaultCxfBinding implements CxfBinding, HeaderFilterStrategyAware
             
             // We need to copy the content-type if the dataformat is RAW
             if (Message.CONTENT_TYPE.equalsIgnoreCase(entry.getKey()) && dataFormat.equals(DataFormat.RAW)) {
-                LOG.debug("Propagate to CXF header: {} value: {}", Message.CONTENT_TYPE, entry.getValue());
-                cxfContext.put(Message.CONTENT_TYPE, entry.getValue().toString());
+                if (entry.getValue() != null) {
+                    LOG.debug("Propagate to CXF header: {} value: {}", Message.CONTENT_TYPE, entry.getValue());
+                    cxfContext.put(Message.CONTENT_TYPE, entry.getValue().toString());
+                }
                 continue;
             }