From 55a69b568fae03e9c59a858c0b0845bb1c609b93 Mon Sep 17 00:00:00 2001 From: Phillip Webb Date: Tue, 13 Nov 2012 12:57:21 -0800 Subject: [PATCH] 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 --- .../webflow/expression/spel/ScopeSearchingPropertyAccessor.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spring-webflow/src/main/java/org/springframework/webflow/expression/spel/ScopeSearchingPropertyAccessor.java b/spring-webflow/src/main/java/org/springframework/webflow/expression/spel/ScopeSearchingPropertyAccessor.java index aa2de70c..9967af00 100644 --- a/spring-webflow/src/main/java/org/springframework/webflow/expression/spel/ScopeSearchingPropertyAccessor.java +++ b/spring-webflow/src/main/java/org/springframework/webflow/expression/spel/ScopeSearchingPropertyAccessor.java @@ -40,7 +40,7 @@ public class ScopeSearchingPropertyAccessor implements PropertyAccessor { public TypedValue read(EvaluationContext context, Object target, String name) throws AccessException { MutableAttributeMap 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 {