You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{
error: "StringIndexOutOfBoundsException[String index out of range: 0]",
status: 500
}
I'm not really sure what is the desired behavior in this case, because it could be one of:
1 - ignore the parameter and treat as if nothing was sent
2 - treat the empty string as the preference parameter
3 - return a friendly error message for it
An empty preference was causing a AIOOB exception in
PlainOperationRouting. We now check for `null` or `empty` instead of
just `null`
Closeselastic#3591
to reproduce(tested on 0.90.3):
this returns:
I'm not really sure what is the desired behavior in this case, because it could be one of:
1 - ignore the parameter and treat as if nothing was sent
2 - treat the empty string as the preference parameter
3 - return a friendly error message for it
anyway, the error happens here (https://github.com/elasticsearch/elasticsearch/blob/master/src/main/java/org/elasticsearch/cluster/routing/operation/plain/PlainOperationRouting.java#L172)
and it could be easily fixed by either making a check for an empty string before comparing its first character, or changing this line https://github.com/elasticsearch/elasticsearch/blob/master/src/main/java/org/elasticsearch/cluster/routing/operation/plain/PlainOperationRouting.java#L164 for something like preference.isEmpty(), which also covers the empty string case.
The text was updated successfully, but these errors were encountered: