This is an automated email from the ASF dual-hosted git repository.
epugh pushed a commit to branch branch_9x
in repository https://gitbox.apache.org/repos/asf/solr.git
The following commit(s) were added to refs/heads/branch_9x by this push:
new 04cf2b30960 SOLR-17209: Fix NullPointerException in QueryComponent
(#2354)
04cf2b30960 is described below
commit 04cf2b30960c68b3c1f634fc8320a8537bcb5de0
Author: Vincent Primault <[email protected]>
AuthorDate: Mon Mar 25 13:04:04 2024 +0100
SOLR-17209: Fix NullPointerException in QueryComponent (#2354)
---------
Co-authored-by: Vincent Primault <[email protected]>
Co-authored-by: Eric Pugh <[email protected]>
---
solr/CHANGES.txt | 2 ++
.../core/src/java/org/apache/solr/handler/component/QueryComponent.java | 2 +-
2 files changed, 3 insertions(+), 1 deletion(-)
diff --git a/solr/CHANGES.txt b/solr/CHANGES.txt
index 0efa84908ce..5d82ce3c5c1 100644
--- a/solr/CHANGES.txt
+++ b/solr/CHANGES.txt
@@ -68,6 +68,8 @@ Bug Fixes
* SOLR-14892: Queries with shards.info and shards.tolerant can yield multiple
null keys in place of shard names
(Mathieu Marie, David Smiley)
+* SOLR-17209: Fix NullPointerException in QueryComponent (Vincent Primault via
Eric Pugh)
+
Dependency Upgrades
---------------------
diff --git
a/solr/core/src/java/org/apache/solr/handler/component/QueryComponent.java
b/solr/core/src/java/org/apache/solr/handler/component/QueryComponent.java
index 8b34422ddfe..4f17cb7652b 100644
--- a/solr/core/src/java/org/apache/solr/handler/component/QueryComponent.java
+++ b/solr/core/src/java/org/apache/solr/handler/component/QueryComponent.java
@@ -956,7 +956,7 @@ public class QueryComponent extends SearchComponent {
if (srsp.getException() != null) {
Throwable t = srsp.getException();
- if (t instanceof SolrServerException) {
+ if (t instanceof SolrServerException && t.getCause() != null) {
t = t.getCause();
}
nl.add("error", t.toString());