Add defensive null check

This commit is contained in:
Dave Syer
2017-06-07 14:46:59 +01:00
parent d641aae494
commit 14867f9685

View File

@@ -490,6 +490,9 @@ public class ContextFunctionCatalogAutoConfiguration {
private Object getField(Object target, String name) {
Field field = ReflectionUtils.findField(target.getClass(), name);
if (field == null) {
return null;
}
ReflectionUtils.makeAccessible(field);
return ReflectionUtils.getField(field, target);
}