From 9aa4b01a670ac7cb101edd8898466e678bd191a1 Mon Sep 17 00:00:00 2001 From: Eric Fossas Date: Mon, 7 May 2018 01:46:18 -0600 Subject: [PATCH] Do not convert null primitive into object when copying it (#504) --- papaparse.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/papaparse.js b/papaparse.js index b7fa8db..4ee8de2 100755 --- a/papaparse.js +++ b/papaparse.js @@ -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)