mirror of
https://gitee.com/dromara/hutool.git
synced 2026-02-09 09:16:26 +08:00
fix(reverseNew方法存在空指针风险):list 为 null,后续逻辑会导致空指针异常。
This commit is contained in:
@@ -360,6 +360,9 @@ public class ListUtil {
|
||||
* @since 4.0.6
|
||||
*/
|
||||
public static <T> List<T> reverseNew(List<T> list) {
|
||||
if (list == null) {
|
||||
return null;
|
||||
}
|
||||
List<T> list2 = ObjectUtil.clone(list);
|
||||
if (null == list2) {
|
||||
// 不支持clone
|
||||
|
||||
Reference in New Issue
Block a user