Get settings on empty node fails with ArrayIndexOutOfBoundsException[0]

fixes #2676
This commit is contained in:
Shay Banon 2013-02-22 22:59:52 +01:00
parent b8cc8e56c4
commit 915019587d
1 changed files with 2 additions and 1 deletions

View File

@ -73,7 +73,8 @@ public class RestGetSettingsAction extends BaseRestHandler {
MetaData metaData = response.getState().metaData();
if (metaData.indices().isEmpty()) {
channel.sendResponse(new XContentThrowableRestResponse(request, new IndexMissingException(new Index(indices[0]))));
String indexName = indices.length == 0 ? "_all" : indices[0];
channel.sendResponse(new XContentThrowableRestResponse(request, new IndexMissingException(new Index(indexName))));
return;
}