fix: 修复潜在的空指针问题

This commit is contained in:
huangchengxing 2022-06-30 15:25:24 +08:00
parent 1f5f0b1f58
commit d1bba67d3a

View File

@ -10,13 +10,7 @@ import cn.hutool.core.util.ClassUtil;
import cn.hutool.core.util.ObjectUtil;
import cn.hutool.core.util.ReflectUtil;
import java.lang.annotation.Annotation;
import java.lang.annotation.Documented;
import java.lang.annotation.ElementType;
import java.lang.annotation.Inherited;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
import java.lang.annotation.*;
import java.lang.reflect.AnnotatedElement;
import java.lang.reflect.Method;
import java.lang.reflect.Proxy;
@ -157,7 +151,7 @@ public class AnnotationUtil {
*/
public static Annotation[] getAnnotations(AnnotatedElement annotationEle, boolean isToCombination, Predicate<Annotation> predicate) {
if (null == annotationEle) {
return null;
return new Annotation[0];
}
if (isToCombination) {