Browse Source

Fix an eventual IndexOutOfBoundsException in RequestPredicates

pull/1483/head
Sebastien Deleuze 8 years ago
parent
commit
0720f9e978
  1. 2
      spring-webflux/src/main/java/org/springframework/web/reactive/function/server/RequestPredicates.java

2
spring-webflux/src/main/java/org/springframework/web/reactive/function/server/RequestPredicates.java

@ -588,7 +588,7 @@ public abstract class RequestPredicates { @@ -588,7 +588,7 @@ public abstract class RequestPredicates {
private static List<Element> prependWithSeparator(List<Element> elements) {
List<Element> result = new ArrayList<>(elements);
if (!(result.get(0) instanceof Separator)) {
if (result.isEmpty() || !(result.get(0) instanceof Separator)) {
result.add(0, SEPARATOR);
}
return Collections.unmodifiableList(result);

Loading…
Cancel
Save