#10061 closed bug (duplicate)
$.data fais in case of retrieving data from a dom element which is no longer in jQuery.cache
Reported by: | Owned by: | ||
---|---|---|---|
Priority: | low | Milestone: | |
Component: | data | Version: | 1.6.2 |
Keywords: | Cc: | ||
Blocked by: | Blocking: |
Description
The issue is described here http://www.datatables.net/forums/discussion/5644/issues-when-removing-datatables-from-the-dom-on-ie8/p1 It rather knotty but in short $.data fails when jquery-ui tries to trigger a "remove" event in it's own overridden $.cleanData function and fails on element which was already removed. This precondition looks like an invalid case, but the fix on jQuery side is pretty straight forward. In line 1455 of full 1.6.2 sorces there is an if condition
if ( (!id || (pvt && id && !cache[ id ][ internalKey ])) && getByName && data === undefined ) { return; }
there cache[ id ] is undefined so !cache[ id ][ internalKey ] fails with NPE. Is it possible to add additional && cache[ id ] check before !cache[ id ][ internalKey ]?
Change History (5)
comment:1 follow-up: 2 Changed 11 years ago by
Component: | unfiled → data |
---|---|
Owner: | set to [email protected]… |
Priority: | undecided → low |
Status: | new → pending |
comment:2 Changed 11 years ago by
Status: | pending → new |
---|
Replying to addyosmani:
Thanks for submitting a ticket. Could you provide us with a reduced test case replicating the behaviour mentioned on jsFiddle so we can investigate further?
Please, here you are http://jsfiddle.net/dbdkN/8/ Fails in IE8. After you run the example press "Reinit Table" button. A error will be thrown: Line: 1455 Error: 'undefined' in null or not an object
comment:3 Changed 11 years ago by
Milestone: | None → 1.6.3 |
---|---|
Resolution: | → duplicate |
Status: | new → closed |
comment:5 Changed 11 years ago by
Milestone: | 1.6.3 |
---|
Thanks for submitting a ticket. Could you provide us with a reduced test case replicating the behaviour mentioned on jsFiddle so we can investigate further?