Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--plugins/org.eclipse.eef.core/src/org/eclipse/eef/core/api/utils/Eval.java4
1 files changed, 2 insertions, 2 deletions
diff --git a/plugins/org.eclipse.eef.core/src/org/eclipse/eef/core/api/utils/Eval.java b/plugins/org.eclipse.eef.core/src/org/eclipse/eef/core/api/utils/Eval.java
index 879ba4395..68f398e03 100644
--- a/plugins/org.eclipse.eef.core/src/org/eclipse/eef/core/api/utils/Eval.java
+++ b/plugins/org.eclipse.eef.core/src/org/eclipse/eef/core/api/utils/Eval.java
@@ -102,7 +102,7 @@ public final class Eval {
IEvaluationResult evaluationResult = this.interpreter.evaluateExpression(this.variables, expression);
if (evaluationResult.success()) {
Object value = evaluationResult.getValue();
- if (expectedResultType.isInstance(value)) {
+ if (expectedResultType.isInstance(value) || (value == null && !expectedResultType.isPrimitive())) {
T castValue = expectedResultType.cast(value);
consumer.apply(castValue);
} else {
@@ -189,7 +189,7 @@ public final class Eval {
IEvaluationResult evaluationResult = this.interpreter.evaluateExpression(this.variables, expression);
if (evaluationResult.success()) {
Object value = evaluationResult.getValue();
- if (expectedResultType.isInstance(value)) {
+ if (expectedResultType.isInstance(value) || (value == null && !expectedResultType.isPrimitive())) {
T castValue = expectedResultType.cast(value);
return castValue;
} else {

Back to the top