Skip to content

Commit

Permalink
fix(spel): Fix NPE in SpEL evaluation
Browse files Browse the repository at this point in the history
Evaluating SpEL on a null object throws an NPE; if the input object
is null, just return null as the evaluated expression.
  • Loading branch information
ezimanyi authored and maggieneterval committed Jun 11, 2019
1 parent a3005f3 commit 5a047c9
Showing 1 changed file with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,10 @@ public Map<String, Object> process(
boolean allowUnknownKeys,
ExpressionEvaluationSummary summary) {

if (source == null) {
return null;
}

if (source.isEmpty()) {
return new HashMap<>();
}
Expand Down

0 comments on commit 5a047c9

Please sign in to comment.