Fix NPE triggered by r1127962
authormarkt <markt@13f79535-47bb-0310-9956-ffa450edef68>
Fri, 27 May 2011 16:35:43 +0000 (16:35 +0000)
committermarkt <markt@13f79535-47bb-0310-9956-ffa450edef68>
Fri, 27 May 2011 16:35:43 +0000 (16:35 +0000)
git-svn-id: https://svn.apache.org/repos/asf/tomcat/trunk@1128386 13f79535-47bb-0310-9956-ffa450edef68

java/org/apache/tomcat/util/net/AbstractEndpoint.java

index bbc7c0a..84fa371 100644 (file)
@@ -114,8 +114,10 @@ public abstract class AbstractEndpoint {
     public void setMaxConnections(int maxCon) {
         this.maxConnections = maxCon;
         LimitLatch latch = this.connectionLimitLatch;
-        // Update the latch that enforces this
-        latch.setLimit(maxCon);
+        if (latch != null) {
+            // Update the latch that enforces this
+            latch.setLimit(maxCon);
+        }
     }
 
     public int  getMaxConnections() { return this.maxConnections; }