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 6ce60bb  Fixed NPE in camel-spring-boot main controller
6ce60bb is described below

commit 6ce60bbc84a8bd94d2d18cd566b5b5367b176f86
Author: Claus Ibsen <claus.ib...@gmail.com>
AuthorDate: Thu Mar 28 10:54:43 2019 +0100

    Fixed NPE in camel-spring-boot main controller
---
 .../camel/spring/boot/CamelSpringBootApplicationController.java    | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git 
a/components/camel-spring-boot/src/main/java/org/apache/camel/spring/boot/CamelSpringBootApplicationController.java
 
b/components/camel-spring-boot/src/main/java/org/apache/camel/spring/boot/CamelSpringBootApplicationController.java
index cfd81c4..04fd47d 100644
--- 
a/components/camel-spring-boot/src/main/java/org/apache/camel/spring/boot/CamelSpringBootApplicationController.java
+++ 
b/components/camel-spring-boot/src/main/java/org/apache/camel/spring/boot/CamelSpringBootApplicationController.java
@@ -35,8 +35,11 @@ public class CamelSpringBootApplicationController {
     private final CountDownLatch latch = new CountDownLatch(1);
     private final AtomicBoolean completed = new AtomicBoolean();
 
-    public CamelSpringBootApplicationController(final ApplicationContext 
applicationContext, final CamelContext camelContext) {
+    public CamelSpringBootApplicationController(final ApplicationContext 
applicationContext, final CamelContext context) {
         this.main = new Main() {
+
+            { this.camelContext = context; }
+
             @Override
             protected ProducerTemplate findOrCreateCamelTemplate() {
                 return applicationContext.getBean(ProducerTemplate.class);
@@ -44,7 +47,7 @@ public class CamelSpringBootApplicationController {
 
             @Override
             protected CamelContext createCamelContext() {
-                return camelContext;
+                return context;
             }
 
             @Override

Reply via email to