Bug Tracker

Opened 7 years ago

Closed 7 years ago

#14092 closed bug (notabug)

Error on triggering event on an element with no handlers.

Reported by: lukasz.chelmicki@… Owned by: lukasz.chelmicki@…
Priority: undecided Milestone: None
Component: unfiled Version: 2.0.2
Keywords: Cc:
Blocked by: Blocking:

Description

on line 4691 there is :

4688: event.data = handleObj.data;
4689: event.handleObj = handleObj;
4690: 
4691: ret = ( (jQuery.event.special[ handleObj.origType ] || {}).handle || handleObj.handler )
4692:     .apply( matched.elem, args );

In this line there is no check if handler exists. My solution to that is:

4688: event.data = handleObj.data;
4689: event.handleObj = handleObj;
4690:
4691: var tmp_handler = ( (jQuery.event.special[ handleObj.origType ] || {}).handle || handleObj.handler );
4692: if (typeof tmp_handler === 'function') {
4693:   ret = tmp_handler.apply( matched.elem, args );
4694: }

I noticed this in version 1.7.2 but it exists in all version up to date.

Change History (5)

comment:1 Changed 7 years ago by dmethvin

Owner: set to lukasz.chelmicki@…
Status: newpending

Do you have an example of code that causes an error? Please create one in jsfiddle.

comment:2 in reply to:  1 Changed 7 years ago by lukasz.chelmicki@…

Status: pendingnew

Replying to dmethvin:

Do you have an example of code that causes an error? Please create one in jsfiddle.

I'll give an example tomorrow at work.

comment:3 Changed 7 years ago by timmywil

Status: newpending

comment:4 Changed 7 years ago by lukasz.chelmicki@…

Status: pendingnew

I tried to reproduce this bug. but it may have been the result of too many recursions. I was passing events between two windows.

You can reject this ticket.

comment:5 Changed 7 years ago by timmywil

Resolution: notabug
Status: newclosed

Thanks for looking into it further.

Note: See TracTickets for help on using tickets.