Skip to content

armgit / solr

Public Imported from GitHub
0

Apache Solr open-source search software

Add null check to avoid NPE during JMX registration

Shalin Shekhar Mangar2cc8be768ae7
diff --git a/src/java/org/apache/solr/search/FastLRUCache.java b/src/java/org/apache/solr/search/FastLRUCache.java
index 634a9d9d90e..fc26c755952 100644
--- a/src/java/org/apache/solr/search/FastLRUCache.java
+++ b/src/java/org/apache/solr/search/FastLRUCache.java
@@ -189,6 +189,7 @@ public class FastLRUCache implements SolrCache {
public NamedList getStatistics() {
NamedList<Serializable> lst = new SimpleOrderedMap<Serializable>();
+ if (cache == null) return lst;
ConcurrentLRUCache.Stats stats = cache.getStats();
long lookups = stats.getCumulativeLookups();
long hits = stats.getCumulativeHits();