diff --git a/iop/dataset.go b/iop/dataset.go index fbb3af0..ee42eec 100644 --- a/iop/dataset.go +++ b/iop/dataset.go @@ -342,7 +342,11 @@ func (data *Dataset) StringRecords(lower ...bool) []map[string]interface{} { for i, row := range data.Rows { rec := map[string]interface{}{} for j, field := range data.GetFields(Lower) { - rec[field] = cast.ToString(row[j]) + if row[j] == nil { + rec[field] = nil + } else { + rec[field] = cast.ToString(row[j]) + } } records[i] = rec }