lucene-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From no...@apache.org
Subject lucene-solr:branch_5_5: SOLR-9339: NPE in CloudSolrClient when the response is null
Date Tue, 26 Jul 2016 07:44:12 GMT
Repository: lucene-solr
Updated Branches:
  refs/heads/branch_5_5 9fbb2fe75 -> 46b284abd


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/46b284ab
Tree: http://git-wip-us.apache.org/repos/asf/lucene-solr/tree/46b284ab
Diff: http://git-wip-us.apache.org/repos/asf/lucene-solr/diff/46b284ab

Branch: refs/heads/branch_5_5
Commit: 46b284abdcef0c0b257391ce2e757314a5ea5c9f
Parents: 9fbb2fe
Author: Noble Paul <noble@apache.org>
Authored: Tue Jul 26 13:08:28 2016 +0530
Committer: Noble Paul <noble@apache.org>
Committed: Tue Jul 26 13:14:04 2016 +0530

----------------------------------------------------------------------
 .../java/org/apache/solr/client/solrj/impl/CloudSolrClient.java    | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/46b284ab/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 c7e670c..a6b8a29 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
@@ -869,7 +869,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);


Mime
View raw message