diff --git a/common/source/java/ch/systemsx/cisd/common/evaluator/Evaluator.java b/common/source/java/ch/systemsx/cisd/common/evaluator/Evaluator.java index e1e1cc36a70503ee5b0a16ce07f544aac19d6582..92e9f9e67db29c42a8989c9a4f0eb3457beb76e7 100644 --- a/common/source/java/ch/systemsx/cisd/common/evaluator/Evaluator.java +++ b/common/source/java/ch/systemsx/cisd/common/evaluator/Evaluator.java @@ -24,6 +24,7 @@ import org.python.core.PyException; import org.python.core.PyFloat; import org.python.core.PyInteger; import org.python.core.PyLong; +import org.python.core.PyNone; import org.python.core.PyObject; import org.python.core.PyString; import org.python.core.PyStringMap; @@ -175,7 +176,8 @@ public final class Evaluator * not know what will be the result type. * * @return evaluation result which can be of Long, Double or String type. All other types are - * converted to String representation. + * converted to String representation except {@link PyNone} that represents null value + * and will be converted to <code>null</code>. */ public Object eval() { @@ -190,6 +192,9 @@ public final class Evaluator } else if (obj instanceof PyFloat) { return new Double(((PyFloat) obj).getValue()); + } else if (obj instanceof PyNone) + { + return null; } else { return obj.toString();