You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@eagle.apache.org by ra...@apache.org on 2016/09/28 00:25:02 UTC

incubator-eagle git commit: [EAGLE-573]: NPE when apply change of EAGLE-569

Repository: incubator-eagle
Updated Branches:
  refs/heads/master 0fac33799 -> 1fa490e0c


[EAGLE-573]: NPE when apply change of EAGLE-569

Author : ralphsu

This closes #458


Project: http://git-wip-us.apache.org/repos/asf/incubator-eagle/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-eagle/commit/1fa490e0
Tree: http://git-wip-us.apache.org/repos/asf/incubator-eagle/tree/1fa490e0
Diff: http://git-wip-us.apache.org/repos/asf/incubator-eagle/diff/1fa490e0

Branch: refs/heads/master
Commit: 1fa490e0c5b0c1b827791909968fcee7adc8ea7c
Parents: 0fac337
Author: Ralph, Su <su...@gmail.com>
Authored: Tue Sep 27 17:22:43 2016 -0700
Committer: Ralph, Su <su...@gmail.com>
Committed: Tue Sep 27 17:25:02 2016 -0700

----------------------------------------------------------------------
 .../alert/engine/publisher/impl/AlertPublisherImpl.java      | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-eagle/blob/1fa490e0/eagle-core/eagle-alert-parent/eagle-alert/alert-engine/src/main/java/org/apache/eagle/alert/engine/publisher/impl/AlertPublisherImpl.java
----------------------------------------------------------------------
diff --git a/eagle-core/eagle-alert-parent/eagle-alert/alert-engine/src/main/java/org/apache/eagle/alert/engine/publisher/impl/AlertPublisherImpl.java b/eagle-core/eagle-alert-parent/eagle-alert/alert-engine/src/main/java/org/apache/eagle/alert/engine/publisher/impl/AlertPublisherImpl.java
index e97a763..87ac30f 100644
--- a/eagle-core/eagle-alert-parent/eagle-alert/alert-engine/src/main/java/org/apache/eagle/alert/engine/publisher/impl/AlertPublisherImpl.java
+++ b/eagle-core/eagle-alert-parent/eagle-alert/alert-engine/src/main/java/org/apache/eagle/alert/engine/publisher/impl/AlertPublisherImpl.java
@@ -74,7 +74,13 @@ public class AlertPublisherImpl implements AlertPublisher {
             LOG.warn("policyId cannot be null for event to be published");
             return;
         }
-        for (String pubId : policyPublishPluginMapping.get(policyId)) {
+        List<String> pubIds = policyPublishPluginMapping.get(policyId);
+        if (pubIds == null) {
+            LOG.warn("Policy {} does *NOT* subscribe any publishment!", policyId);
+            return;
+        }
+
+        for (String pubId : pubIds) {
             AlertPublishPlugin plugin = pubId != null ? publishPluginMapping.get(pubId) : null;
             if (plugin == null) {
                 LOG.warn("Policy {} does *NOT* subscribe any publishment!", policyId);