SOLR-3117: CoreDescriptor attempts to use the name before checking if it is null

git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1243390 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Mark Robert Miller 2012-02-13 01:39:11 +00:00
parent 03c278ce04
commit 06fae9dfbb
1 changed files with 5 additions and 4 deletions

View File

@ -43,15 +43,16 @@ public class CoreDescriptor {
this.coreContainer = coreContainer;
this.name = name;
if (name == null) {
throw new RuntimeException("Core needs a name");
}
if(coreContainer != null && coreContainer.getZkController() != null) {
this.cloudDesc = new CloudDescriptor();
// cloud collection defaults to core name
cloudDesc.setCollectionName(name.isEmpty() ? coreContainer.getDefaultCoreName() : name);
}
if (name == null) {
throw new RuntimeException("Core needs a name");
}
if (instanceDir == null) {
throw new NullPointerException("Missing required \'instanceDir\'");
}