Exit early from _.contains if length is 0 to avoid potentially mucking up getIndexOf by passing it an undefined collection.

This commit is contained in:
John-David Dalton
2014-09-24 11:12:14 -07:00
parent 073f715f17
commit 54dc1e2e15

View File

@@ -4712,6 +4712,9 @@
collection = values(collection);
length = collection.length;
}
if (!length) {
return false;
}
if (typeof fromIndex == 'number') {
fromIndex = fromIndex < 0 ? nativeMax(length + fromIndex, 0) : (fromIndex || 0);
} else {