You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by da...@apache.org on 2025/09/24 11:50:23 UTC

(camel) branch main updated: CAMEL-22444: camel-bean: Fix NPE if beanName is not provided.

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.git


The following commit(s) were added to refs/heads/main by this push:
     new 84f36e704a4 CAMEL-22444: camel-bean: Fix NPE if beanName is not provided.
84f36e704a4 is described below

commit 84f36e704a42455ddf3126509d431b67d226e587
Author: Claus Ibsen <cl...@gmail.com>
AuthorDate: Wed Sep 24 13:50:09 2025 +0200

    CAMEL-22444: camel-bean: Fix NPE if beanName is not provided.
---
 .../src/main/java/org/apache/camel/component/bean/BeanEndpoint.java     | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/components/camel-bean/src/main/java/org/apache/camel/component/bean/BeanEndpoint.java b/components/camel-bean/src/main/java/org/apache/camel/component/bean/BeanEndpoint.java
index c9a008d35a5..0d01f93417d 100644
--- a/components/camel-bean/src/main/java/org/apache/camel/component/bean/BeanEndpoint.java
+++ b/components/camel-bean/src/main/java/org/apache/camel/component/bean/BeanEndpoint.java
@@ -30,6 +30,7 @@ import org.apache.camel.spi.UriEndpoint;
 import org.apache.camel.spi.UriParam;
 import org.apache.camel.spi.UriPath;
 import org.apache.camel.support.DefaultEndpoint;
+import org.apache.camel.util.ObjectHelper;
 
 /**
  * Invoke methods of Java beans stored in Camel registry.
@@ -97,6 +98,7 @@ public class BeanEndpoint extends DefaultEndpoint {
         super.doInit();
 
         if (processor == null) {
+            ObjectHelper.notNull(beanName, "beanName", this);
             BeanHolder holder = getBeanHolder();
             if (holder == null) {
                 ParameterMappingStrategy strategy