Browse Source

avoid division by zero

if preview didn't find a row, avgFieldCount will be NaN or Infinity
pull/204/head
Jan Hesse 10 years ago
parent
commit
40f5ebcbf2
  1. 3
      papaparse.js

3
papaparse.js

@ -903,7 +903,8 @@ @@ -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)

Loading…
Cancel
Save