From 89718c0dfd674a69fbd165ede4c93d28b6f52554 Mon Sep 17 00:00:00 2001 From: markt Date: Wed, 14 Jan 2009 20:46:02 +0000 Subject: [PATCH] Fix possible NPE reported by Eclipse 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 | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/java/org/apache/catalina/tribes/io/BufferPool.java b/java/org/apache/catalina/tribes/io/BufferPool.java index 6b8d3d61e..bd236b92c 100644 --- a/java/org/apache/catalina/tribes/io/BufferPool.java +++ b/java/org/apache/catalina/tribes/io/BufferPool.java @@ -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 -- 2.11.0