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 2024/03/22 05:13:40 UTC

(camel) branch main updated: Added null check on header (#13575)

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

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


The following commit(s) were added to refs/heads/main by this push:
     new 03ba5e19b54 Added null check on header (#13575)
03ba5e19b54 is described below

commit 03ba5e19b546174e267336c62b6b8b00d1356fe1
Author: Vishal Bihani <vi...@gmail.com>
AuthorDate: Fri Mar 22 10:43:33 2024 +0530

    Added null check on header (#13575)
---
 .../camel/component/salesforce/internal/processor/RawProcessor.java | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/internal/processor/RawProcessor.java b/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/internal/processor/RawProcessor.java
index 3c900a44964..87097b9eef1 100644
--- a/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/internal/processor/RawProcessor.java
+++ b/components/camel-salesforce/camel-salesforce-component/src/main/java/org/apache/camel/component/salesforce/internal/processor/RawProcessor.java
@@ -77,6 +77,12 @@ public class RawProcessor extends AbstractSalesforceProcessor {
                         path.append("&");
                     }
                     path.append(p).append("=");
+
+                    if (exchange.getIn().getHeader(p) == null) {
+                        throw new SalesforceException(
+                                String.format("Missing header with key: %s", p)
+                        );
+                    }
                     path.append(urlEncode(exchange.getIn().getHeader(p).toString()));
                 }
             }