diff --git a/papaparse.js b/papaparse.js index ad84d24..e955e4a 100644 --- a/papaparse.js +++ b/papaparse.js @@ -903,7 +903,8 @@ } } - avgFieldCount /= preview.data.length; + if (preview.data.length > 0) + avgFieldCount /= preview.data.length; if ((typeof bestDelta === 'undefined' || delta < bestDelta) && avgFieldCount > 1.99)