The extractFacetInfo(...)  method of QueryResponse object throws
NullPointerExcpetion when the facetQueries are null.

The code in bold  will throw NullPointerException if the fq param is null.

    // Parse the queries
    _facetQuery = new HashMap<String, Integer>();
    NamedList<Integer> fq = (NamedList<Integer>) info.get( "facet_queries"
);
    for( Map.Entry<String, Integer> entry : fq ) {
      _facetQuery.put( entry.getKey(), entry.getValue() );
    }

the patch for this is

    // Parse the queries
    _facetQuery = new HashMap<String, Integer>();
    NamedList<Integer> fq = (NamedList<Integer>) info.get( "facet_queries"
);
if(fq!= null)
{
for( Map.Entry<String, Integer> entry : fq ) {
      _facetQuery.put( entry.getKey(), entry.getValue() );
    }
}
-- 
View this message in context: 
http://www.nabble.com/Facet-query-throws-NullPointerException-when-the-facetqueries-response-is-null-in-QueryResponse-object-tp25492240p25492240.html
Sent from the Solr - Dev mailing list archive at Nabble.com.

Reply via email to