Apache Solr open-source search software
throw a good error rather than NPE when no collection is found to request against
Mark Robert Millerf75eae6217b5
diff --git a/solr/solrj/src/java/org/apache/solr/client/solrj/impl/CloudSolrServer.java b/solr/solrj/src/java/org/apache/solr/client/solrj/impl/CloudSolrServer.javaindex a9d467d4dda..5e2c117a556 100644--- a/solr/solrj/src/java/org/apache/solr/client/solrj/impl/CloudSolrServer.java+++ b/solr/solrj/src/java/org/apache/solr/client/solrj/impl/CloudSolrServer.java@@ -142,6 +142,10 @@ public class CloudSolrServer extends SolrServer {}String collection = reqParams.get("collection", defaultCollection);+ if (collection == null) {+ throw new SolrServerException("No collection param specified on request and no default collection has been set.");+ }+// Extract each comma separated collection name and store in a List.List<String> collectionList = StrUtils.splitSmart(collection, ",", true);