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:57 UTC

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

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

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


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

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

    CAMEL-19675: ensure the safeCopyProperties is present before copying (#10962)
---
 .../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