add null check

git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1245927 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Mark Robert Miller 2012-02-18 14:26:23 +00:00
parent a668cc9a5e
commit 1cf9bc4e28
1 changed files with 5 additions and 0 deletions

View File

@ -528,6 +528,11 @@ public class DistributedUpdateProcessor extends UpdateRequestProcessor {
boolean leaderForAnyShard = false; // start off by assuming we are not a leader for any shard
Map<String,Slice> slices = zkController.getCloudState().getSlices(collection);
if (slices == null) {
throw new SolrException(ErrorCode.BAD_REQUEST,
"Cannot find collection:" + collection + " in "
+ zkController.getCloudState().getCollections());
}
ModifiableSolrParams params = new ModifiableSolrParams(req.getParams());
params.set(DELETE_BY_QUERY_LEVEL, 2);