Make sure events exist before trying to access them in jQuery.event.handle and removed unnecessary var statement. Fixes #6163.

This commit is contained in:
brandonaaron 2010-02-27 01:31:33 -06:00
parent 9e06903a99
commit 7d5da0ee03

View file

@ -374,7 +374,8 @@ jQuery.event = {
namespace = new RegExp("(^|\\.)" + namespaces.slice(0).sort().join("\\.(?:.*\\.)?") + "(\\.|$)");
}
var events = jQuery.data(this, "events"), handlers = events[ event.type ];
events = jQuery.data(this, "events");
handlers = (events || {})[ event.type ];
if ( events && handlers ) {
// Clone the handlers to prevent manipulation