You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by or...@apache.org on 2023/08/02 12:47:51 UTC

[camel] branch camel-3.21.x updated: CAMEL-19675: ensure the safeCopyProperties is present before copying (#10961)

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

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


The following commit(s) were added to refs/heads/camel-3.21.x by this push:
     new d7d0c05f34b CAMEL-19675: ensure the safeCopyProperties is present before copying (#10961)
d7d0c05f34b is described below

commit d7d0c05f34b7e37192acc2fcfd8d16248e7573be
Author: Otavio Rodolfo Piske <or...@users.noreply.github.com>
AuthorDate: Wed Aug 2 14:47:45 2023 +0200

    CAMEL-19675: ensure the safeCopyProperties is present before copying (#10961)
---
 .../src/main/java/org/apache/camel/support/AbstractExchange.java    | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/core/camel-support/src/main/java/org/apache/camel/support/AbstractExchange.java b/core/camel-support/src/main/java/org/apache/camel/support/AbstractExchange.java
index 92bd3aec906..67c2f486bd7 100644
--- a/core/camel-support/src/main/java/org/apache/camel/support/AbstractExchange.java
+++ b/core/camel-support/src/main/java/org/apache/camel/support/AbstractExchange.java
@@ -212,8 +212,10 @@ class AbstractExchange implements ExtendedExchange {
 
     @Override
     public void copySafeCopyPropertiesTo(ExtendedExchange target) {
-        safeCopyProperties.entrySet()
-                .forEach(entry -> target.setSafeCopyProperty(entry.getKey(), entry.getValue().safeCopy()));
+        if (safeCopyProperties != null && !safeCopyProperties.isEmpty()) {
+            safeCopyProperties.entrySet()
+                    .forEach(entry -> target.setSafeCopyProperty(entry.getKey(), entry.getValue().safeCopy()));
+        }
     }
 
     @Override