#8314 closed bug (invalid)
acceptData does not check if elem is defined
Reported by: | dcz | Owned by: | |
---|---|---|---|
Priority: | low | Milestone: | 1.next |
Component: | data | Version: | 1.5 |
Keywords: | Cc: | ||
Blocked by: | Blocking: |
Description
Hello, I had posted this topic (with no luck) : http://forum.jquery.com/topic/resizable-and-datepick
And the same thing happens with 1.5 : http://jsfiddle.net/wesEy/4/
The same "fix" applies to, eg add :
if (!elem) return false;
after :
// A method for determining if a DOM node can handle the data expando acceptData: function( elem ) {
Also, it does not seem to be wrong to return false, using : #!js
if (!elem) return true;
}}}
will also throw an error a little later (which seems to mean that indeed no data could be accepted from this null element.
I know the issue seems related to datepicker (I did not find other test cases), but it seems rather sane to me to perform the test on elem in this method.
Regards,
dcz
Change History (3)
comment:1 Changed 12 years ago by
Component: | unfiled → data |
---|---|
Priority: | undecided → low |
Resolution: | → invalid |
Status: | new → closed |
comment:2 follow-up: 3 Changed 12 years ago by
I perfectly get your point about jquery not being necessarily the guilty one, but unfortunately, I could not find out where this guilty call was made in the first place. The funny thing being everything still works despite the error thrown. I contacted datepicker author and also posted in the ui forum with the success you know.
Though, since the fix I found for this was in jquery and since it did not seemed insane to me to add this small line of sanity check, I decided that it was still worth reporting here.
comment:3 Changed 12 years ago by
Replying to dcz:
..., but unfortunately, I could not find out where this guilty call was made in the first place.
Not sure what you mean by that. Any debugger in a recent browser will point out directly where the bug happened + stacktrace http://i.imgur.com/XEALR.jpg
Thanks for taking the time to contribute to the jQuery project by writing a bug report.
I took a quick look at your test case. This is not a jQuery bug. It's a bug in the jQuery plugin you use. It makes incorrect use of the
jQuery.data()
method, the documentation reads:undefined
is not a DOM element.So garbage in, garbage out. File a ticket with the plugin author.
The big red box on the "New Ticket" page rather clearly states:
This tracker you submitted your bug on. is for jQuery core bugs only. Bug reports for plugins should be filed on the plugin site or directly to the respective authors of those plugins. You can also try posting to the correct subforum in the jQuery Forum or in the #jquery irc channel on freenode