mirror of
https://gitee.com/chinabugotech/hutool.git
synced 2025-05-09 23:51:34 +08:00
fix:ListUtil.reverse()方法,当该方法的参数list为null对象时,出现空指针异常
This commit is contained in:
parent
5753444de2
commit
f37edfd84f
@ -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