This is an automated email from the ASF dual-hosted git repository. davsclaus pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/camel.git
The following commit(s) were added to refs/heads/master by this push: new 6a2b08f Kamelet: Ensure camel route input is not null. (#5107) 6a2b08f is described below commit 6a2b08ffbc2c253e7ebfb67a33fb5c10e4998aa2 Author: James Hilliard <james.hillia...@gmail.com> AuthorDate: Tue Feb 23 11:10:38 2021 -0700 Kamelet: Ensure camel route input is not null. (#5107) Fixes NullPointerException --- .../src/main/java/org/apache/camel/component/kamelet/Kamelet.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/components/camel-kamelet/src/main/java/org/apache/camel/component/kamelet/Kamelet.java b/components/camel-kamelet/src/main/java/org/apache/camel/component/kamelet/Kamelet.java index acf396d..d5bd8ca 100644 --- a/components/camel-kamelet/src/main/java/org/apache/camel/component/kamelet/Kamelet.java +++ b/components/camel-kamelet/src/main/java/org/apache/camel/component/kamelet/Kamelet.java @@ -116,6 +116,10 @@ public final class Kamelet { RouteDefinition def = in.asRouteDefinition(); def.setId(rid); + if (def.getInput() == null) { + throw new IllegalArgumentException("Camel route " + rid + " input does not exist."); + } + // must make the source and sink endpoints are unique by appending the route id before we create the route from the template if (def.getInput().getEndpointUri().startsWith("kamelet:source") || def.getInput().getEndpointUri().startsWith("kamelet://source")) {