Skip to content

Commit

Permalink
Make sure events exist before trying to access them in jQuery.event.h…
Browse files Browse the repository at this point in the history
…andle and removed unnecessary var statement. Fixes #6163.
  • Loading branch information
brandonaaron committed Feb 27, 2010
1 parent 9e06903 commit 7d5da0e
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/event.js
Expand Up @@ -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
Expand Down

1 comment on commit 7d5da0e

@brandonaaron
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not visible in this diff, the events and handlers are already declared as variables at the beginning of jQuery.event.handle.

Please sign in to comment.