mirror of
https://gitee.com/chinabugotech/hutool.git
synced 2025-07-21 15:09:48 +08:00
fix NPE
This commit is contained in:
@@ -65,7 +65,7 @@ public class PropDesc {
|
||||
*/
|
||||
public PropDesc(final Field field, final Method getter, final Method setter) {
|
||||
this(FieldUtil.getFieldName(field), getter, setter);
|
||||
this.fieldInvoker = null == field ? null : FieldInvoker.of(field);
|
||||
this.fieldInvoker = FieldInvoker.of(field);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@@ -49,7 +49,7 @@ public class FieldInvoker implements Invoker {
|
||||
* @return {@code FieldInvoker}
|
||||
*/
|
||||
public static FieldInvoker of(final Field field) {
|
||||
return new FieldInvoker(field);
|
||||
return null == field ? null : new FieldInvoker(field);
|
||||
}
|
||||
|
||||
private final Field field;
|
||||
|
@@ -38,7 +38,7 @@ public class MethodInvoker implements Invoker {
|
||||
* @return 方法调用器
|
||||
*/
|
||||
public static MethodInvoker of(final Method method) {
|
||||
return new MethodInvoker(method);
|
||||
return null == method ? null : new MethodInvoker(method);
|
||||
}
|
||||
|
||||
private final Method method;
|
||||
|
Reference in New Issue
Block a user