mirror of
https://gitee.com/chinabugotech/hutool.git
synced 2025-04-19 03:01:48 +08:00
fix out of index
This commit is contained in:
parent
181b83a75e
commit
1c9d06979b
@ -261,6 +261,9 @@ public class ListUtil {
|
||||
final int[] startEnd = PageUtil.transToStartEnd(pageNo, pageSize);
|
||||
if (startEnd[1] > resultSize) {
|
||||
startEnd[1] = resultSize;
|
||||
if (startEnd[0] > startEnd[1]) {
|
||||
return new ArrayList<>(0);
|
||||
}
|
||||
}
|
||||
|
||||
return list.subList(startEnd[0], startEnd[1]);
|
||||
|
Loading…
x
Reference in New Issue
Block a user