Legibility: Only get the value of node from messages once.

This commit is contained in:
Gus Heck 2020-06-06 12:00:04 -04:00
parent 291e358a3d
commit 14a988cc2a
1 changed files with 1 additions and 1 deletions

View File

@ -145,7 +145,7 @@ public class AddReplicaCmd implements OverseerCollectionMessageHandler.Cmd {
totalReplicas += entry.getValue();
}
if (totalReplicas > 1) {
if (message.getStr(CoreAdminParams.NAME) != null) {
if (node != null) {
throw new SolrException(SolrException.ErrorCode.BAD_REQUEST, "Cannot create " + totalReplicas + " replicas if 'name' parameter is specified");
}
if (message.getStr(CoreAdminParams.CORE_NODE_NAME) != null) {