Merge pull request #140 from jbescos/astValueNullPointer
NullPointerException when value and targetType is null
diff --git a/impl/src/main/java/com/sun/el/parser/AstValue.java b/impl/src/main/java/com/sun/el/parser/AstValue.java
index 2b99930..1b9bd48 100644
--- a/impl/src/main/java/com/sun/el/parser/AstValue.java
+++ b/impl/src/main/java/com/sun/el/parser/AstValue.java
@@ -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
@@ -217,7 +217,7 @@
if (ctx.isPropertyResolved()) {
value = targetValue;
} else {
- if (value != null || targetType.isPrimitive()) {
+ if (value != null || (targetType != null && targetType.isPrimitive())) {
value = ELSupport.coerceToType(value, targetType);
}
}