diff --git a/DB/src/main/java/io/deephaven/db/tables/lang/DBLanguageParser.java b/DB/src/main/java/io/deephaven/db/tables/lang/DBLanguageParser.java index dccc4c34967..4292cd7a873 100644 --- a/DB/src/main/java/io/deephaven/db/tables/lang/DBLanguageParser.java +++ b/DB/src/main/java/io/deephaven/db/tables/lang/DBLanguageParser.java @@ -1178,7 +1178,7 @@ else if (fromBoxedType) { if (toPrimitive && !ret.equals(boolean.class) && !ret.equals(exprType)) { // Casting to a primitive, except booleans and the identity conversion printer.append(ret.getSimpleName()); - if (isAssignableFrom(PyObject.class, exprType)) { + if (exprType != NULL_CLASS && isAssignableFrom(PyObject.class, exprType)) { printer.append("PyCast((PyObject)"); } else { printer.append("Cast(");