From: Rick Waldron Date: Fri, 21 Dec 2012 20:24:42 +0000 (-0500) Subject: Ensure that null/undefined args don't choke on native indexOf X-Git-Tag: 2.0.0b1~57^2~2 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=dcf94a58c7419083cb10ea645c97c8d8c740810b;p=jquery.git Ensure that null/undefined args don't choke on native indexOf Signed-off-by: Rick Waldron --- diff --git a/src/core.js b/src/core.js index 6fad83b2a..4f99e0f4c 100644 --- a/src/core.js +++ b/src/core.js @@ -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 ) {