!224 修复subList越界异常

Merge pull request !224 from movescar/v5-master
This commit is contained in:
Looly 2020-12-04 11:08:04 +08:00 committed by Gitee
commit f444295bd7

View File

@ -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]);