]> source.dussan.org Git - jquery.git/commitdiff
Fix #12423. Ensure we can .apply() before we try.
authorDave Methvin <dave.methvin@gmail.com>
Tue, 18 Sep 2012 18:26:21 +0000 (14:26 -0400)
committerDave Methvin <dave.methvin@gmail.com>
Tue, 18 Sep 2012 18:26:40 +0000 (14:26 -0400)
I can't think of an uncontrived way to unit test this, it only occurs in IE when a BHO monkeys with the links.

src/event.js

index d4c17cf31ba0e7fc69542fc1e339c494fc2bfd38..c9231dabb1cf861ab8148b5d3fb7540bd10076c2 100644 (file)
@@ -317,7 +317,7 @@ jQuery.event = {
                        }
                        // Note that this is a bare JS function and not a jQuery handler
                        handle = ontype && cur[ ontype ];
-                       if ( handle && jQuery.acceptData( cur ) && handle.apply( cur, data ) === false ) {
+                       if ( handle && jQuery.acceptData( cur ) && handle.apply && handle.apply( cur, data ) === false ) {
                                event.preventDefault();
                        }
                }