Browse Source

Do not convert null primitive into object when copying it (#504)

pull/509/head
Eric Fossas 7 years ago committed by Sergi Almacellas Abellana
parent
commit
9aa4b01a67
  1. 2
      papaparse.js

2
papaparse.js

@ -1632,7 +1632,7 @@ @@ -1632,7 +1632,7 @@
/** Makes a deep copy of an array or object (mostly) */
function copy(obj)
{
if (typeof obj !== 'object')
if (typeof obj !== 'object' || obj === null)
return obj;
var cpy = obj instanceof Array ? [] : {};
for (var key in obj)

Loading…
Cancel
Save