mirror of
https://gitee.com/chinabugotech/hutool.git
synced 2025-04-19 03:01:48 +08:00
Merge pull request #2891 from LuisStruggle/v6-dev-2
ListUtil.reverse()方法,当该方法的参数list为null对象时,出现空指针异常
This commit is contained in:
commit
67be1e398b
@ -386,6 +386,9 @@ public class ListUtil {
|
||||
* @since 4.0.6
|
||||
*/
|
||||
public static <T> List<T> reverse(final List<T> list) {
|
||||
if (CollUtil.isEmpty(list)) {
|
||||
return list;
|
||||
}
|
||||
Collections.reverse(list);
|
||||
return list;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user