throw a good error rather than NPE when no collection is found to request against

git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1294894 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Mark Robert Miller 2012-02-28 23:36:53 +00:00
parent a1fbc36305
commit f75eae6217
1 changed files with 4 additions and 0 deletions

View File

@ -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);