]> source.dussan.org Git - jquery.git/commitdiff
Make sure events exist before trying to access them in jQuery.event.handle and remove...
authorbrandonaaron <brandon.aaron@gmail.com>
Sat, 27 Feb 2010 07:31:33 +0000 (01:31 -0600)
committerbrandonaaron <brandon.aaron@gmail.com>
Sat, 27 Feb 2010 07:31:33 +0000 (01:31 -0600)
src/event.js

index bfe2dd1af0896ae87eb2641f869373a19335f45c..5369b85bd0259df2bb686e3fe638428677ef3396 100644 (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