]> source.dussan.org Git - jquery.git/commitdiff
Ensure that null/undefined args don't choke on native indexOf
authorRick Waldron <waldron.rick@gmail.com>
Fri, 21 Dec 2012 20:24:42 +0000 (15:24 -0500)
committerRick Waldron <waldron.rick@gmail.com>
Wed, 26 Dec 2012 18:34:38 +0000 (13:34 -0500)
Signed-off-by: Rick Waldron <waldron.rick@gmail.com>
src/core.js

index 6fad83b2a48536266b5d8c03f768b0dd41d28f11..4f99e0f4c2dfacd15ec99c0f7c8c893112f8affc 100644 (file)
@@ -587,7 +587,7 @@ jQuery.extend({
        },
 
        inArray: function( elem, arr, i ) {
-               return core_indexOf.call( arr, elem, i );
+               return arr == null ? -1 : core_indexOf.call( arr, elem, i );
        },
 
        merge: function( first, second ) {