mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-10 10:57:49 +00:00
Guard against nullish value being passed to arrayCopy in baseMergeDeep.
This commit is contained in:
committed by
jdalton
parent
439ffa5849
commit
cd69a53406
@@ -2522,8 +2522,11 @@
|
|||||||
if (isCommon) {
|
if (isCommon) {
|
||||||
result = srcValue;
|
result = srcValue;
|
||||||
if (isLength(srcValue.length) && (isArray(srcValue) || isTypedArray(srcValue))) {
|
if (isLength(srcValue.length) && (isArray(srcValue) || isTypedArray(srcValue))) {
|
||||||
result = isArray(value) ? value : arrayCopy(value);
|
result = isArray(value)
|
||||||
} else if (isPlainObject(srcValue) || isArguments(srcValue)) {
|
? value
|
||||||
|
: (value ? arrayCopy(value) : []);
|
||||||
|
}
|
||||||
|
else if (isPlainObject(srcValue) || isArguments(srcValue)) {
|
||||||
result = isArguments(value)
|
result = isArguments(value)
|
||||||
? arrayToObject(value)
|
? arrayToObject(value)
|
||||||
: (isPlainObject(value) ? value : {});
|
: (isPlainObject(value) ? value : {});
|
||||||
|
|||||||
Reference in New Issue
Block a user