Fix potential ScopeSearchingPropertyAccessor NPE
ScopeSearchingPropertyAccessor.read() now returns a TypedValue representing null rather than null itself. This prevents a NullPointerException from being thrown from deeper within the Spring SpEL code Issue: SWF-1572
This commit is contained in:
@@ -40,7 +40,7 @@ public class ScopeSearchingPropertyAccessor implements PropertyAccessor {
|
||||
|
||||
public TypedValue read(EvaluationContext context, Object target, String name) throws AccessException {
|
||||
MutableAttributeMap<Object> scope = findScopeForAttribute((RequestContext) target, name);
|
||||
return (scope != null) ? new TypedValue(scope.get(name)) : null;
|
||||
return new TypedValue(scope == null ? null : scope.get(name));
|
||||
}
|
||||
|
||||
public boolean canWrite(EvaluationContext context, Object target, String name) throws AccessException {
|
||||
|
||||
Reference in New Issue
Block a user