From cd69a53406f86bf8765704fe84523472d4086619 Mon Sep 17 00:00:00 2001 From: John-David Dalton Date: Fri, 16 Jan 2015 03:11:59 -0800 Subject: [PATCH] Guard against nullish value being passed to `arrayCopy` in `baseMergeDeep`. --- lodash.src.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/lodash.src.js b/lodash.src.js index a1ea1acf5..04237b4b3 100644 --- a/lodash.src.js +++ b/lodash.src.js @@ -2522,8 +2522,11 @@ if (isCommon) { result = srcValue; if (isLength(srcValue.length) && (isArray(srcValue) || isTypedArray(srcValue))) { - result = isArray(value) ? value : arrayCopy(value); - } else if (isPlainObject(srcValue) || isArguments(srcValue)) { + result = isArray(value) + ? value + : (value ? arrayCopy(value) : []); + } + else if (isPlainObject(srcValue) || isArguments(srcValue)) { result = isArguments(value) ? arrayToObject(value) : (isPlainObject(value) ? value : {});