From fac232ecb45df8f307aa1df34822975f6793a53d Mon Sep 17 00:00:00 2001 From: Bartosz Popiela Date: Fri, 27 Dec 2024 01:47:49 +0100 Subject: [PATCH] CAMEL-21572: fix java.lang.NullPointerException when using SetHeader and Stub --- .../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 d860a9239d1fd..0dc5a361c2114 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 @@ -2123,7 +2123,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;