From: brandonaaron Date: Sat, 27 Feb 2010 07:31:33 +0000 (-0600) Subject: Make sure events exist before trying to access them in jQuery.event.handle and remove... X-Git-Url: http://git.asbjorn.biz/?p=jquery.git;a=commitdiff_plain;h=7d5da0ee030b1962ff1ff57b0221a02dfdc2886a Make sure events exist before trying to access them in jQuery.event.handle and removed unnecessary var statement. Fixes #6163. --- diff --git a/src/event.js b/src/event.js index bfe2dd1..5369b85 100644 --- a/src/event.js +++ b/src/event.js @@ -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