diff --git a/fcli-core/fcli-common/src/main/java/com/fortify/cli/common/output/writer/record/expr/ExprRecordWriter.java b/fcli-core/fcli-common/src/main/java/com/fortify/cli/common/output/writer/record/expr/ExprRecordWriter.java index 7078017886..142e885d8c 100644 --- a/fcli-core/fcli-common/src/main/java/com/fortify/cli/common/output/writer/record/expr/ExprRecordWriter.java +++ b/fcli-core/fcli-common/src/main/java/com/fortify/cli/common/output/writer/record/expr/ExprRecordWriter.java @@ -55,7 +55,8 @@ public void writeRecord(ObjectNode record) { private String getFormattedRecord(ObjectNode record) { try { - return JsonHelper.evaluateSpelExpression(record, expression, String.class); + var result = JsonHelper.evaluateSpelExpression(record, expression, String.class); + return result==null ? "" : result; } catch ( Exception e ) { throw new IllegalStateException(String.format("Error evaluating output expression:\n\tMessage: %s\n\tExpression: %s\n\tRecord: %s", e.getMessage(), getConfig().getOptions(), record.toPrettyString().replace("\n", "\n\t\t"))); }