From: jeresig Date: Wed, 13 Jan 2010 16:24:54 +0000 (-0500) Subject: Make sure no exception is thrown if no event handler is found (which is the case... X-Git-Url: http://git.asbjorn.biz/?p=jquery.git;a=commitdiff_plain;h=1960f28c0bf75b16e88460d6135058fd93202322 Make sure no exception is thrown if no event handler is found (which is the case for applets, objects, and embeds). --- diff --git a/src/event.js b/src/event.js index 0234998..c826f17 100644 --- a/src/event.js +++ b/src/event.js @@ -57,6 +57,12 @@ jQuery.event = { handle = jQuery.data( elem, "handle", eventHandle ); } + // If no handle is found then we must be trying to bind to one of the + // banned noData elements + if ( !handle ) { + return; + } + // Add elem as a property of the handle function // This is to prevent a memory leak with non-native // event in IE.