Skip to content

Commit 0cc877a

Browse files
committed
MethodReference accesses cached executor in a thread-safe manner
Issue: SPR-12269
1 parent 6009c09 commit 0cc877a

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

spring-expression/src/main/java/org/springframework/expression/spel/ast/MethodReference.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -230,7 +230,7 @@ private void throwSimpleExceptionIfPossible(Object value, AccessException ae) {
230230

231231
private void updateExitTypeDescriptor() {
232232
CachedMethodExecutor executorToCheck = this.cachedExecutor;
233-
if (executorToCheck.get() instanceof ReflectiveMethodExecutor) {
233+
if (executorToCheck != null && executorToCheck.get() instanceof ReflectiveMethodExecutor) {
234234
Method method = ((ReflectiveMethodExecutor) executorToCheck.get()).getMethod();
235235
this.exitTypeDescriptor = CodeFlow.toDescriptor(method.getReturnType());
236236
}

0 commit comments

Comments
 (0)