Add null check to avoid NPE during JMX registration

git-svn-id: https://svn.apache.org/repos/asf/lucene/solr/trunk@708824 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Shalin Shekhar Mangar 2008-10-29 08:30:57 +00:00
parent a61286806e
commit 2cc8be768a
1 changed files with 1 additions and 0 deletions

View File

@ -189,6 +189,7 @@ public class FastLRUCache implements SolrCache {
public NamedList getStatistics() { public NamedList getStatistics() {
NamedList<Serializable> lst = new SimpleOrderedMap<Serializable>(); NamedList<Serializable> lst = new SimpleOrderedMap<Serializable>();
if (cache == null) return lst;
ConcurrentLRUCache.Stats stats = cache.getStats(); ConcurrentLRUCache.Stats stats = cache.getStats();
long lookups = stats.getCumulativeLookups(); long lookups = stats.getCumulativeLookups();
long hits = stats.getCumulativeHits(); long hits = stats.getCumulativeHits();