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 2021/07/02 15:27:14 UTC

[camel] branch camel-3.11.x updated: CAMEL-16767: camel-core - Fix NPE in Loop EIP if it was not called before.

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

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


The following commit(s) were added to refs/heads/camel-3.11.x by this push:
     new 1e4e327  CAMEL-16767: camel-core - Fix NPE in Loop EIP if it was not called before.
1e4e327 is described below

commit 1e4e327fe4495d0005c406d368bbe1229232d950
Author: Claus Ibsen <cl...@gmail.com>
AuthorDate: Fri Jul 2 17:25:54 2021 +0200

    CAMEL-16767: camel-core - Fix NPE in Loop EIP if it was not called before.
---
 .../src/main/java/org/apache/camel/processor/LoopProcessor.java       | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/core/camel-core-processor/src/main/java/org/apache/camel/processor/LoopProcessor.java b/core/camel-core-processor/src/main/java/org/apache/camel/processor/LoopProcessor.java
index 1b45f44..e70f188 100644
--- a/core/camel-core-processor/src/main/java/org/apache/camel/processor/LoopProcessor.java
+++ b/core/camel-core-processor/src/main/java/org/apache/camel/processor/LoopProcessor.java
@@ -47,7 +47,7 @@ public class LoopProcessor extends DelegateAsyncProcessor implements Traceable,
 
     private String id;
     private String routeId;
-    private LoopState state;
+    private volatile LoopState state;
     private boolean shutdownPending;
     private final CamelContext camelContext;
     private final ReactiveExecutor reactiveExecutor;
@@ -92,7 +92,7 @@ public class LoopProcessor extends DelegateAsyncProcessor implements Traceable,
 
     @Override
     public int getPendingExchangesSize() {
-        return state.getPendingSize();
+        return state != null ? state.getPendingSize() : 0;
     }
 
     @Override