Skip to content

Commit dcf94a5

Browse files
committed
Ensure that null/undefined args don't choke on native indexOf
Signed-off-by: Rick Waldron <waldron.rick@gmail.com>
1 parent 1d0322f commit dcf94a5

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/core.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -587,7 +587,7 @@ jQuery.extend({
587587
},
588588

589589
inArray: function( elem, arr, i ) {
590-
return core_indexOf.call( arr, elem, i );
590+
return arr == null ? -1 : core_indexOf.call( arr, elem, i );
591591
},
592592

593593
merge: function( first, second ) {

0 commit comments

Comments
 (0)