获取属性的get方法空值验证
This commit is contained in:
@ -891,7 +891,7 @@ public class ExcelUtil<T>
|
|||||||
*/
|
*/
|
||||||
private Object getValue(Object o, String name) throws Exception
|
private Object getValue(Object o, String name) throws Exception
|
||||||
{
|
{
|
||||||
if (StringUtils.isNotEmpty(name))
|
if (StringUtils.isNotNull(o) && StringUtils.isNotEmpty(name))
|
||||||
{
|
{
|
||||||
Class<?> clazz = o.getClass();
|
Class<?> clazz = o.getClass();
|
||||||
Field field = clazz.getDeclaredField(name);
|
Field field = clazz.getDeclaredField(name);
|
||||||
|
Reference in New Issue
Block a user