From 0720f9e9786a79503420a5c39f079f5d19aa8736 Mon Sep 17 00:00:00 2001 From: Sebastien Deleuze Date: Thu, 20 Jul 2017 16:00:31 +0200 Subject: [PATCH] Fix an eventual IndexOutOfBoundsException in RequestPredicates --- .../web/reactive/function/server/RequestPredicates.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spring-webflux/src/main/java/org/springframework/web/reactive/function/server/RequestPredicates.java b/spring-webflux/src/main/java/org/springframework/web/reactive/function/server/RequestPredicates.java index e4ed5cebf7..8e88006032 100644 --- a/spring-webflux/src/main/java/org/springframework/web/reactive/function/server/RequestPredicates.java +++ b/spring-webflux/src/main/java/org/springframework/web/reactive/function/server/RequestPredicates.java @@ -588,7 +588,7 @@ public abstract class RequestPredicates { private static List prependWithSeparator(List elements) { List 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);