diff --git a/modules/elasticsearch/src/main/java/org/elasticsearch/action/search/type/TransportSearchHelper.java b/modules/elasticsearch/src/main/java/org/elasticsearch/action/search/type/TransportSearchHelper.java index ec6f04015b6..c48841513c4 100644 --- a/modules/elasticsearch/src/main/java/org/elasticsearch/action/search/type/TransportSearchHelper.java +++ b/modules/elasticsearch/src/main/java/org/elasticsearch/action/search/type/TransportSearchHelper.java @@ -127,6 +127,9 @@ public abstract class TransportSearchHelper { for (int i = 0; i < contextSize; i++) { String element = elements[index++]; int sep = element.indexOf(':'); + if (sep == -1) { + throw new ElasticSearchIllegalArgumentException("Malformed scrollId [" + scrollId + "]"); + } context[i] = new Tuple(element.substring(sep + 1), Long.parseLong(element.substring(0, sep))); } Map attributes;