diff --git a/lib/shred.js b/lib/shred.js index 0525aad9..1e082b1d 100644 --- a/lib/shred.js +++ b/lib/shred.js @@ -79,7 +79,7 @@ function shredRecordInternal(fields, record, data, rlvl, dlvl) { // fetch values let values = []; - if (record && (fieldName in record)) { + if (record && (fieldName in record) && record[fieldName] !== undefined && record[fieldName] !== null) { if (record[fieldName].constructor === Array) { values = record[fieldName]; } else { diff --git a/test/integration.js b/test/integration.js index 58bda015..5cfb2089 100644 --- a/test/integration.js +++ b/test/integration.js @@ -68,6 +68,7 @@ function mkTestRows(opts) { rows.push({ name: 'kiwi', price: 4.2, + quantity: undefined, day: new Date('2017-11-26'), date: new Date(TEST_VTIME + 8000 * i), finger: "FNORD",