You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucene.apache.org by no...@apache.org on 2016/07/26 07:40:04 UTC

lucene-solr:branch_6x: SOLR-9339: NPE in CloudSolrClient when the response is null

Repository: lucene-solr
Updated Branches:
  refs/heads/branch_6x 30db9e72b -> 3a1fe0a8e


SOLR-9339: NPE in CloudSolrClient when the response is null


Project: http://git-wip-us.apache.org/repos/asf/lucene-solr/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucene-solr/commit/3a1fe0a8
Tree: http://git-wip-us.apache.org/repos/asf/lucene-solr/tree/3a1fe0a8
Diff: http://git-wip-us.apache.org/repos/asf/lucene-solr/diff/3a1fe0a8

Branch: refs/heads/branch_6x
Commit: 3a1fe0a8ee5d64f268f33b887754af1d5d28a185
Parents: 30db9e7
Author: Noble Paul <no...@apache.org>
Authored: Tue Jul 26 13:08:28 2016 +0530
Committer: Noble Paul <no...@apache.org>
Committed: Tue Jul 26 13:09:44 2016 +0530

----------------------------------------------------------------------
 solr/CHANGES.txt                                                   | 2 ++
 .../java/org/apache/solr/client/solrj/impl/CloudSolrClient.java    | 2 +-
 2 files changed, 3 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/3a1fe0a8/solr/CHANGES.txt
----------------------------------------------------------------------
diff --git a/solr/CHANGES.txt b/solr/CHANGES.txt
index 13e528d..d1cd01f 100644
--- a/solr/CHANGES.txt
+++ b/solr/CHANGES.txt
@@ -132,6 +132,8 @@ Bug Fixes
 
 * SOLR-9334: CloudSolrClient.collectionStateCache is unbounded (noble)
 
+* SOLR-9339: NPE in CloudSolrClient when the response is null (noble)
+
 
 Optimizations
 ----------------------

http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/3a1fe0a8/solr/solrj/src/java/org/apache/solr/client/solrj/impl/CloudSolrClient.java
----------------------------------------------------------------------
diff --git a/solr/solrj/src/java/org/apache/solr/client/solrj/impl/CloudSolrClient.java b/solr/solrj/src/java/org/apache/solr/client/solrj/impl/CloudSolrClient.java
index ec3f837..4bce970 100644
--- a/solr/solrj/src/java/org/apache/solr/client/solrj/impl/CloudSolrClient.java
+++ b/solr/solrj/src/java/org/apache/solr/client/solrj/impl/CloudSolrClient.java
@@ -1060,7 +1060,7 @@ public class CloudSolrClient extends SolrClient {
     try {
       resp = sendRequest(request, collection);
       //to avoid an O(n) operation we always add STATE_VERSION to the last and try to read it from there
-      Object o = resp.get(STATE_VERSION, resp.size()-1);
+      Object o = resp == null || resp.size() == 0 ? null : resp.get(STATE_VERSION, resp.size() - 1);
       if(o != null && o instanceof Map) {
         //remove this because no one else needs this and tests would fail if they are comparing responses
         resp.remove(resp.size()-1);