You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@sling.apache.org by tm...@apache.org on 2019/05/11 14:11:51 UTC

[sling-org-apache-sling-distribution-journal] branch master updated: SLING-8415 - check for null subState

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

tmaret pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-distribution-journal.git


The following commit(s) were added to refs/heads/master by this push:
     new 469077c  SLING-8415 - check for null subState
469077c is described below

commit 469077c09022917124ece518f6e5398421c972f0
Author: tmaret <tm...@adobe.com>
AuthorDate: Sat May 11 16:11:32 2019 +0200

    SLING-8415 - check for null subState
---
 .../journal/impl/publisher/DistributionPublisher.java             | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/src/main/java/org/apache/sling/distribution/journal/impl/publisher/DistributionPublisher.java b/src/main/java/org/apache/sling/distribution/journal/impl/publisher/DistributionPublisher.java
index 91f0d71..f5ac277 100644
--- a/src/main/java/org/apache/sling/distribution/journal/impl/publisher/DistributionPublisher.java
+++ b/src/main/java/org/apache/sling/distribution/journal/impl/publisher/DistributionPublisher.java
@@ -209,9 +209,11 @@ public class DistributionPublisher implements DistributionAgent {
         for (String subAgentId : view.getSubscribedAgentIds(pubAgentName)) {
             queueNames.add(subAgentId);
             State subState = view.getState(subAgentId, pubAgentName);
-            boolean errorQueueEnabled = (subState.getMaxRetries() >= 0);
-            if (errorQueueEnabled) {
-                queueNames.add(String.format("%s-error", subAgentId));
+            if (subState != null) {
+                boolean errorQueueEnabled = (subState.getMaxRetries() >= 0);
+                if (errorQueueEnabled) {
+                    queueNames.add(String.format("%s-error", subAgentId));
+                }
             }
         }
         return Collections.unmodifiableCollection(queueNames);