Author: bstansberry(a)jboss.com
Date: 2008-01-14 16:46:01 -0500 (Mon, 14 Jan 2008)
New Revision: 5127
Modified:
pojo/trunk/src/main/java/org/jboss/cache/pojo/jmx/PojoCacheJmxWrapper.java
Log:
Avoid NPEs in destroy()
Modified: pojo/trunk/src/main/java/org/jboss/cache/pojo/jmx/PojoCacheJmxWrapper.java
===================================================================
--- pojo/trunk/src/main/java/org/jboss/cache/pojo/jmx/PojoCacheJmxWrapper.java 2008-01-14
21:43:41 UTC (rev 5126)
+++ pojo/trunk/src/main/java/org/jboss/cache/pojo/jmx/PojoCacheJmxWrapper.java 2008-01-14
21:46:01 UTC (rev 5127)
@@ -251,13 +251,15 @@
{
cacheStatus = CacheStatus.DESTROYING;
- pojoCache.destroy();
+ if (pojoCache != null)
+ pojoCache.destroy();
// The cache is destroyed, so we shouldn't leave it registered
// in JMX even if we didn't register it in create()
unregisterPlainCache();
- plainCacheWrapper.destroy();
+ if (plainCacheWrapper != null)
+ plainCacheWrapper.destroy();
}
finally
{
Show replies by date