You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by ac...@apache.org on 2020/09/17 06:03:54 UTC

[camel] branch camel-15534-3.4.x created (now f102d88)

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

acosentino pushed a change to branch camel-15534-3.4.x
in repository https://gitbox.apache.org/repos/asf/camel.git.


      at f102d88  CAMEL-15534 - Camel-telegram wrongly parse chatId from headers

This branch includes the following new commits:

     new f102d88  CAMEL-15534 - Camel-telegram wrongly parse chatId from headers

The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.



[camel] 01/01: CAMEL-15534 - Camel-telegram wrongly parse chatId from headers

Posted by ac...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

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

commit f102d88b3bf96518f72504ce4c9f0502baca0770
Author: Andrea Cosentino <an...@gmail.com>
AuthorDate: Thu Sep 17 08:00:49 2020 +0200

    CAMEL-15534 - Camel-telegram wrongly parse chatId from headers
---
 .../java/org/apache/camel/component/telegram/TelegramProducer.java   | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/components/camel-telegram/src/main/java/org/apache/camel/component/telegram/TelegramProducer.java b/components/camel-telegram/src/main/java/org/apache/camel/component/telegram/TelegramProducer.java
index d8ae65c..cd6c7e3 100644
--- a/components/camel-telegram/src/main/java/org/apache/camel/component/telegram/TelegramProducer.java
+++ b/components/camel-telegram/src/main/java/org/apache/camel/component/telegram/TelegramProducer.java
@@ -20,6 +20,7 @@ import org.apache.camel.AsyncCallback;
 import org.apache.camel.Exchange;
 import org.apache.camel.component.telegram.model.OutgoingMessage;
 import org.apache.camel.support.DefaultAsyncProducer;
+import org.apache.camel.util.ObjectHelper;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -80,7 +81,9 @@ public class TelegramProducer extends DefaultAsyncProducer {
 
         // Get the chat id from headers
         if (chatId == null) {
-            chatId = (String) exchange.getIn().getHeader(TelegramConstants.TELEGRAM_CHAT_ID);
+            if (ObjectHelper.isNotEmpty(exchange.getIn().getHeader(TelegramConstants.TELEGRAM_CHAT_ID))) {
+                chatId = String.valueOf(exchange.getIn().getHeader(TelegramConstants.TELEGRAM_CHAT_ID));
+            }
         }
 
         // If not present in the headers, use the configured value for chat id