Guard against nullish value being passed to arrayCopy in baseMergeDeep.

This commit is contained in:
John-David Dalton
2015-01-16 03:11:59 -08:00
committed by jdalton
parent 439ffa5849
commit cd69a53406

View File

@@ -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 : {});