You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@sling.apache.org by st...@apache.org on 2013/06/06 16:38:28 UTC

svn commit: r1490303 - /sling/trunk/bundles/extensions/discovery/impl/src/main/java/org/apache/sling/discovery/impl/cluster/voting/VotingView.java

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;