From 915019587d5fb0c085f84c9f08c474de35744ae8 Mon Sep 17 00:00:00 2001 From: Shay Banon Date: Fri, 22 Feb 2013 22:59:52 +0100 Subject: [PATCH] Get settings on empty node fails with ArrayIndexOutOfBoundsException[0] fixes #2676 --- .../action/admin/indices/settings/RestGetSettingsAction.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/main/java/org/elasticsearch/rest/action/admin/indices/settings/RestGetSettingsAction.java b/src/main/java/org/elasticsearch/rest/action/admin/indices/settings/RestGetSettingsAction.java index c7b53376f39..09140f2f7fb 100644 --- a/src/main/java/org/elasticsearch/rest/action/admin/indices/settings/RestGetSettingsAction.java +++ b/src/main/java/org/elasticsearch/rest/action/admin/indices/settings/RestGetSettingsAction.java @@ -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; }