Skip to main content

Bug Tracker

Side navigation

#6444 closed bug (fixed)

Opened April 15, 2010 05:34PM UTC

Closed April 16, 2010 12:33AM UTC

Last modified March 15, 2012 07:24PM UTC

jQuery.cleanData calls on null objects (causing script breakage)

Reported by: StefanKendall Owned by:
Priority: Milestone: 1.4.2
Component: core Version: 1.4.2
Keywords: cleanData Cc:
Blocked by: Blocking:
Description

The 'cleanData' method references a possibly null cache item and makes calls on it under certain odd edge cases. Specifically, this snippet of code in the cleanData method is at fault:

if ( id ) { data = cache[ id ]; if ( data.events ) {

In my execution, I've encountered data = null, which causes script breakage. If this is modified as such, no breakage occurs:

if ( id ) { data = cache[ id ]; if ( data && data.events ) {

I'm unsure why the cache is not populated, and this may be a separate issue entirely, but adding this guard prevents against null cache items.

Attachments (0)
Change History (3)

Changed April 15, 2010 05:43PM UTC by StefanKendall comment:1

This also fails in 1.4.3pre. I've only noticed an invalid cache in IE6/7/8, but regardless, guarding against null data resolves the issue. In 1.3.2, I do not see any breakage in my application, although I haven't done any extensive testing or investigation to see if similar jQuery code paths are hit at all.

Changed April 15, 2010 08:00PM UTC by StefanKendall comment:2

Changed April 16, 2010 12:33AM UTC by dmethvin comment:3

resolution: → fixed
status: newclosed

Thanks!