This is an automated email from the ASF dual-hosted git repository. orpiske pushed a commit to branch camel-3.x in repository https://gitbox.apache.org/repos/asf/camel.git
The following commit(s) were added to refs/heads/camel-3.x by this push: new 9cf882a4d4d CAMEL-19675: ensure the safeCopyProperties is present before copying (#10960) 9cf882a4d4d is described below commit 9cf882a4d4d2519e6b00689738427a18e81aedc7 Author: Otavio Rodolfo Piske <orpi...@users.noreply.github.com> AuthorDate: Wed Aug 2 14:47:36 2023 +0200 CAMEL-19675: ensure the safeCopyProperties is present before copying (#10960) --- .../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