incubator-sling-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From stefane...@apache.org
Subject svn commit: r1490303 - /sling/trunk/bundles/extensions/discovery/impl/src/main/java/org/apache/sling/discovery/impl/cluster/voting/VotingView.java
Date Thu, 06 Jun 2013 14:38:28 GMT
Author: stefanegli
Date: Thu Jun  6 14:38:27 2013
New Revision: 1490303

URL: http://svn.apache.org/r1490303
Log:
SLING-2914 : fix NPE unveiled by SLING-2914 : a voting handler might be tempted to participate
in a voting while the local instance doesnt send heartbeats

Modified:
    sling/trunk/bundles/extensions/discovery/impl/src/main/java/org/apache/sling/discovery/impl/cluster/voting/VotingView.java

Modified: sling/trunk/bundles/extensions/discovery/impl/src/main/java/org/apache/sling/discovery/impl/cluster/voting/VotingView.java
URL: http://svn.apache.org/viewvc/sling/trunk/bundles/extensions/discovery/impl/src/main/java/org/apache/sling/discovery/impl/cluster/voting/VotingView.java?rev=1490303&r1=1490302&r2=1490303&view=diff
==============================================================================
--- sling/trunk/bundles/extensions/discovery/impl/src/main/java/org/apache/sling/discovery/impl/cluster/voting/VotingView.java
(original)
+++ sling/trunk/bundles/extensions/discovery/impl/src/main/java/org/apache/sling/discovery/impl/cluster/voting/VotingView.java
Thu Jun  6 14:38:27 2013
@@ -204,7 +204,11 @@ public class VotingView extends View {
      * @return true if the given slingId has voted yes or is the initiator of this voting
      */
     public boolean hasVotedOrIsInitiator(final String slingId) {
-        final Resource memberResource = getResource().getChild("members").getChild(
+        Resource members = getResource().getChild("members");
+        if (members==null) {
+        	return false;
+        }
+		final Resource memberResource = members.getChild(
                 slingId);
         if (memberResource == null) {
             return false;



Mime
View raw message