Skip to content

SPEL: NullPointerException when passing null values as parameters to method calls [SPR-5661] #10332

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
spring-projects-issues opened this issue Apr 8, 2009 · 1 comment
Assignees
Labels
type: bug A general bug
Milestone

Comments

@spring-projects-issues
Copy link
Collaborator

Oliver Becker opened SPR-5661 and commented

Currently it is not possible to pass a null value as a parameter to a method in SPEL, because Spring tries to determine the class of the passed parameter, which results in a NullPointerException:

java.lang.NullPointerException
at org.springframework.expression.spel.ast.MethodReference.getTypes(MethodReference.java:94)
at org.springframework.expression.spel.ast.MethodReference.getValueInternal(MethodReference.java:76)
at org.springframework.expression.spel.ast.CompoundExpression.getValueInternal(CompoundExpression.java:53)
at org.springframework.expression.spel.ast.Ternary.getValueInternal(Ternary.java:52)
at org.springframework.expression.spel.ast.SpelNodeImpl.getValue(SpelNodeImpl.java:51)
at org.springframework.expression.spel.SpelExpression.getValue(SpelExpression.java:64)

Of course Spring should be able to handle such values.


Affects: 3.0 M2

@spring-projects-issues
Copy link
Collaborator Author

Andy Clement commented

I happened to have fixed this last night in the repo. Regression test added.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: bug A general bug
Projects
None yet
Development

No branches or pull requests

2 participants