Skip to content

Commit

Permalink
SOLR-17034: Hitting /solr// ends up with HttpSolrCall NPE when using …
Browse files Browse the repository at this point in the history
…Solr Cloud (#2020)
  • Loading branch information
risdenk committed Oct 23, 2023
1 parent 9cd588e commit f33d102
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions solr/core/src/java/org/apache/solr/servlet/HttpSolrCall.java
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
import java.util.LinkedHashSet;
import java.util.List;
import java.util.Map;
import java.util.Objects;
import java.util.Random;
import java.util.Set;
import java.util.concurrent.TimeUnit;
Expand Down Expand Up @@ -1044,11 +1045,11 @@ private String getCoreUrl(String collectionName,
if (!activeReplicas || (liveNodes.contains(replica.getNodeName())
&& replica.getState() == Replica.State.ACTIVE)) {

if (byCoreName && !origCorename.equals(replica.getStr(CORE_NAME_PROP))) {
if (byCoreName && !Objects.equals(origCorename, replica.getStr(CORE_NAME_PROP))) {
// if it's by core name, make sure they match
continue;
}
if (replica.getBaseUrl().equals(cores.getZkController().getBaseUrl())) {
if (Objects.equals(replica.getBaseUrl(), cores.getZkController().getBaseUrl())) {
// don't count a local core
continue;
}
Expand Down

0 comments on commit f33d102

Please sign in to comment.