SOLR-8254: HttpSolrCore.getCoreByCollection() can throw NPE

git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1713468 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Alan Woodward 2015-11-09 16:17:20 +00:00
parent 4921f13576
commit 1057db3e14
2 changed files with 5 additions and 4 deletions

View File

@ -351,6 +351,9 @@ Bug Fixes
* SOLR-8255: MiniSolrCloudCluster needs to use a thread-safe list to keep track
of its child nodes (Alan Woodward)
* SOLR-8254: HttpSolrCore.getCoreByCollection() can throw NPE (Alan Woodward,
Mark Miller)
Optimizations
----------------------

View File

@ -783,10 +783,8 @@ public class HttpSolrCall {
for (Map.Entry<String, Slice> entry : entries) {
// first see if we have the leader
Replica leaderProps = clusterState.getLeader(collection, entry.getKey());
if (liveNodes.contains(leaderProps.getNodeName()) && leaderProps.getState() == Replica.State.ACTIVE) {
if (leaderProps != null) {
core = checkProps(leaderProps);
}
if (leaderProps != null && liveNodes.contains(leaderProps.getNodeName()) && leaderProps.getState() == Replica.State.ACTIVE) {
core = checkProps(leaderProps);
if (core != null) {
return core;
}