Fixed NumberFormatException in the rest layer by only setting batch_size if it has been specified.

This commit is contained in:
Martijn van Groningen 2017-12-07 09:34:25 +01:00
parent 0dc5a89bc5
commit 6c06aacb57
1 changed files with 3 additions and 1 deletions

View File

@ -41,7 +41,9 @@ public class RestFollowExistingIndexAction extends BaseRestHandler {
Request request = new Request();
request.setLeaderIndex(restRequest.param("leader_index"));
request.setFollowIndex(restRequest.param("follow_index"));
request.setBatchSize(Long.valueOf(restRequest.param("batch_size")));
if (restRequest.hasParam("batch_size")) {
request.setBatchSize(Long.valueOf(restRequest.param("batch_size")));
}
return channel -> client.execute(INSTANCE, request, new RestBuilderListener<Response>(channel) {
@Override
public RestResponse buildResponse(Response response, XContentBuilder builder) throws Exception {