From bacd4e510f9c17c66c8171bb19e600cdf742badd Mon Sep 17 00:00:00 2001 From: Bartosz Popiela Date: Fri, 27 Dec 2024 10:13:23 +0100 Subject: [PATCH] CAMEL-21572: fix java.lang.NullPointerException when using SetHeader and Stub (#16657) --- .../org/apache/camel/support/builder/ExpressionBuilder.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/camel-support/src/main/java/org/apache/camel/support/builder/ExpressionBuilder.java b/core/camel-support/src/main/java/org/apache/camel/support/builder/ExpressionBuilder.java index 9d27fc8adac91..8508272a029df 100644 --- a/core/camel-support/src/main/java/org/apache/camel/support/builder/ExpressionBuilder.java +++ b/core/camel-support/src/main/java/org/apache/camel/support/builder/ExpressionBuilder.java @@ -2209,7 +2209,7 @@ public void init(CamelContext context) { expression.init(context); if (expression instanceof ConstantExpressionAdapter constantExpressionAdapter) { Object value = constantExpressionAdapter.getValue(); - preprocessedExpression.add(value.toString()); + preprocessedExpression.add(String.valueOf(value)); } else { preprocessedExpression.add(expression); constantsOnly = false;