BZ 42803
authorfhanik <fhanik@13f79535-47bb-0310-9956-ffa450edef68>
Tue, 3 Jul 2007 13:31:05 +0000 (13:31 +0000)
committerfhanik <fhanik@13f79535-47bb-0310-9956-ffa450edef68>
Tue, 3 Jul 2007 13:31:05 +0000 (13:31 +0000)
git-svn-id: https://svn.apache.org/repos/asf/tomcat/trunk@552838 13f79535-47bb-0310-9956-ffa450edef68

java/org/apache/catalina/tribes/tipis/AbstractReplicatedMap.java

index 2e097f5..573a6d7 100644 (file)
@@ -986,11 +986,11 @@ public abstract class AbstractReplicatedMap extends ConcurrentHashMap implements
             //only count active members in this node
             int counter = 0;
             Iterator it = super.entrySet().iterator();
-            while (it.hasNext() ) {
+            while (it!=null && it.hasNext() ) {
                 Map.Entry e = (Map.Entry) it.next();
                 if ( e != null ) {
                     MapEntry entry = (MapEntry) super.get(e.getKey());
-                    if (entry.isPrimary() && entry.getValue() != null) counter++;
+                    if (entry!=null && entry.isPrimary() && entry.getValue() != null) counter++;
                 }
             }
             return counter;