lucene-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From broust...@apache.org
Subject [lucene-solr] branch master updated: SOLR-15061: Fix NPE in SearchHandler when shards.info and no QueryComponent configured
Date Tue, 05 Jan 2021 14:18:56 GMT
This is an automated email from the ASF dual-hosted git repository.

broustant pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/lucene-solr.git


The following commit(s) were added to refs/heads/master by this push:
     new 5e21e3f  SOLR-15061: Fix NPE in SearchHandler when shards.info and no QueryComponent
configured
5e21e3f is described below

commit 5e21e3f380bead8fc21c493ca134f73d4514d76f
Author: Bruno Roustant <broustant@salesforce.com>
AuthorDate: Thu Dec 24 11:43:04 2020 +0100

    SOLR-15061: Fix NPE in SearchHandler when shards.info and no QueryComponent configured
---
 solr/CHANGES.txt                                                       | 2 ++
 .../core/src/java/org/apache/solr/handler/component/SearchHandler.java | 3 +--
 2 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/solr/CHANGES.txt b/solr/CHANGES.txt
index 5426eb8..a7ccf36 100644
--- a/solr/CHANGES.txt
+++ b/solr/CHANGES.txt
@@ -281,6 +281,8 @@ Bug Fixes
 * SOLR-15031: Fix preventing null being wrapped in a QueryValueSource subQuery. Such null
queries can be caused by query text
   resulting in an empty token stream. (Pieter van Boxtel via Mike Drob)
 
+* SOLR-15061: Fix NPE in SearchHandler when shards.info and no QueryComponent configured.
(Bruno Roustant)
+
 Other Changes
 ---------------------
 
diff --git a/solr/core/src/java/org/apache/solr/handler/component/SearchHandler.java b/solr/core/src/java/org/apache/solr/handler/component/SearchHandler.java
index 39e9795..f5c2474 100644
--- a/solr/core/src/java/org/apache/solr/handler/component/SearchHandler.java
+++ b/solr/core/src/java/org/apache/solr/handler/component/SearchHandler.java
@@ -521,8 +521,7 @@ public class SearchHandler extends RequestHandlerBase implements SolrCoreAware,
         StringWriter trace = new StringWriter();
         cause.printStackTrace(new PrintWriter(trace));
         nl.add("trace", trace.toString() );
-      }
-      else {
+      } else if (rb.getResults() != null) {
         nl.add("numFound", rb.getResults().docList.matches());
         nl.add("numFoundExact", rb.getResults().docList.hitCountRelation() == TotalHits.Relation.EQUAL_TO);
         nl.add("maxScore", rb.getResults().docList.maxScore());


Mime
View raw message