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

davsclaus pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/camel-spring-boot.git


The following commit(s) were added to refs/heads/main by this push:
     new 9b2b4ff54f6 CAMEL-22936 actuator: do not write error.message if null 
(#1642)
9b2b4ff54f6 is described below

commit 9b2b4ff54f61024f2253ed89e6feafb98121a045
Author: Michael Kroll <[email protected]>
AuthorDate: Fri Jan 30 16:53:05 2026 +0100

    CAMEL-22936 actuator: do not write error.message if null (#1642)
    
    detail key and value are not allowed to be null, but 
`Throwable#getMessage()` may return `null`
---
 .../apache/camel/spring/boot/actuate/health/CamelHealthHelper.java    | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git 
a/core/camel-spring-boot/src/main/java/org/apache/camel/spring/boot/actuate/health/CamelHealthHelper.java
 
b/core/camel-spring-boot/src/main/java/org/apache/camel/spring/boot/actuate/health/CamelHealthHelper.java
index ac64499765c..9f04a67428a 100644
--- 
a/core/camel-spring-boot/src/main/java/org/apache/camel/spring/boot/actuate/health/CamelHealthHelper.java
+++ 
b/core/camel-spring-boot/src/main/java/org/apache/camel/spring/boot/actuate/health/CamelHealthHelper.java
@@ -60,7 +60,9 @@ final class CamelHealthHelper {
             });
 
             result.getError().ifPresent(error -> {
-                builder.withDetail("error.message", error.getMessage());
+                if (error.getMessage() != null) {
+                    builder.withDetail("error.message", error.getMessage());
+                }
                 final StringWriter stackTraceWriter = new StringWriter();
                 try (final PrintWriter pw = new PrintWriter(stackTraceWriter, 
true)) {
                     error.printStackTrace(pw);

Reply via email to