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/11/13 11:23:34 UTC

[camel] 04/05: camel-core - Fixed NPE in Recipient List EIP

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

commit abde1cd224dfda4a33f65c9403340e589a6068a6
Author: Claus Ibsen <cl...@gmail.com>
AuthorDate: Sat Nov 13 11:59:36 2021 +0100

    camel-core - Fixed NPE in Recipient List EIP
---
 .../main/java/org/apache/camel/processor/RecipientListProcessor.java  | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/core/camel-core-processor/src/main/java/org/apache/camel/processor/RecipientListProcessor.java b/core/camel-core-processor/src/main/java/org/apache/camel/processor/RecipientListProcessor.java
index 20665d1..1c472d4 100644
--- a/core/camel-core-processor/src/main/java/org/apache/camel/processor/RecipientListProcessor.java
+++ b/core/camel-core-processor/src/main/java/org/apache/camel/processor/RecipientListProcessor.java
@@ -218,9 +218,7 @@ public class RecipientListProcessor extends MulticastProcessor {
                 index = doCreateProcessorExchangePairs(exchange, recipient, result, index);
             }
             return result;
-        } else if (recipientList.getClass().isArray()) {
-            // TODO upper checks against instanceof do not cause NullPointerException,
-            //  but here we potentially get it because of de-referencing
+        } else if (recipientList != null && recipientList.getClass().isArray()) {
             Object[] arr = (Object[]) recipientList;
             int size = Array.getLength(recipientList);
             List<ProcessorExchangePair> result = new ArrayList<>(size);