Skip to content

Commit 0720f9e

Browse files
committed
Fix an eventual IndexOutOfBoundsException in RequestPredicates
1 parent f1abcba commit 0720f9e

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -588,7 +588,7 @@ private static String prefixWithSlash(String path) {
588588

589589
private static List<Element> prependWithSeparator(List<Element> elements) {
590590
List<Element> result = new ArrayList<>(elements);
591-
if (!(result.get(0) instanceof Separator)) {
591+
if (result.isEmpty() || !(result.get(0) instanceof Separator)) {
592592
result.add(0, SEPARATOR);
593593
}
594594
return Collections.unmodifiableList(result);

0 commit comments

Comments
 (0)