From 9b385eac4ff667277f5d3e26406a477a3e65eb9d Mon Sep 17 00:00:00 2001 From: Dimitris - Rafail Katsampas Date: Thu, 4 Nov 2021 18:46:53 +0200 Subject: [PATCH] fix: Do not call `assignDeep` for `null` values. --- lib/util.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/util.js b/lib/util.js index d9b3d20..98d99c5 100644 --- a/lib/util.js +++ b/lib/util.js @@ -84,7 +84,7 @@ function assignDeep(object, value) { const copy = {}; for (const key in object) { copy[key] = - typeof object[key] === 'object' ? assignDeep(object[key], value) : value; + typeof object[key] === 'object' && !isNullish(object[key]) ? assignDeep(object[key], value) : value; } return copy; }