Fix possible NPE reported by Eclipse
authormarkt <markt@13f79535-47bb-0310-9956-ffa450edef68>
Wed, 14 Jan 2009 20:46:02 +0000 (20:46 +0000)
committermarkt <markt@13f79535-47bb-0310-9956-ffa450edef68>
Wed, 14 Jan 2009 20:46:02 +0000 (20:46 +0000)
git-svn-id: https://svn.apache.org/repos/asf/tomcat/trunk@734507 13f79535-47bb-0310-9956-ffa450edef68

java/org/apache/catalina/tribes/io/BufferPool.java

index 6b8d3d6..bd236b9 100644 (file)
@@ -68,9 +68,11 @@ public class BufferPool {
                        log.warn("Unable to initilize BufferPool, not pooling XByteBuffer objects:"+x.getMessage());
                        if ( log.isDebugEnabled() ) log.debug("Unable to initilize BufferPool, not pooling XByteBuffer objects:",x);
                    }
-                   pool.setMaxSize(DEFAULT_POOL_SIZE);
-                   log.info("Created a buffer pool with max size:"+DEFAULT_POOL_SIZE+" bytes of type:"+(clazz!=null?clazz.getName():"null"));
-                   instance = new BufferPool(pool);
+                   if (pool != null) {
+                       pool.setMaxSize(DEFAULT_POOL_SIZE);
+                       log.info("Created a buffer pool with max size:"+DEFAULT_POOL_SIZE+" bytes of type:"+(clazz!=null?clazz.getName():"null"));
+                       instance = new BufferPool(pool);
+                   }
                 }//end if
             }//sync
         }//end if