Skip to content

Commit

Permalink
NullPointerException when value and targetType is null
Browse files Browse the repository at this point in the history
Signed-off-by: Jorge Bescos Gascon <jorge.bescos.gascon@oracle.com>
  • Loading branch information
jbescos committed Sep 23, 2020
1 parent 288f7cd commit 7ba85fb
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions impl/src/main/java/com/sun/el/parser/AstValue.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright (c) 1997, 2018 Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1997, 2020 Oracle and/or its affiliates. All rights reserved.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v. 2.0, which is available at
Expand Down Expand Up @@ -217,7 +217,7 @@ public void setValue(EvaluationContext ctx, Object value) throws ELException {
if (ctx.isPropertyResolved()) {
value = targetValue;
} else {
if (value != null || targetType.isPrimitive()) {
if (value != null || (targetType != null && targetType.isPrimitive())) {
value = ELSupport.coerceToType(value, targetType);
}
}
Expand Down

0 comments on commit 7ba85fb

Please sign in to comment.