Skip to content

Commit f44d5e1

Browse files
committed
Ensure cache[id] exists before attempting to delete it. Fixes #10080
1 parent 1a738cb commit f44d5e1

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/data.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,8 @@ jQuery.extend({
191191
// Browsers that fail expando deletion also refuse to delete expandos on
192192
// the window, but it will allow it on all other JS objects; other browsers
193193
// don't care
194-
if ( jQuery.support.deleteExpando || cache != window ) {
194+
// Ensure that this id actually exists in `cache` #10080
195+
if ( cache[ id ] && ( jQuery.support.deleteExpando || cache != window ) ) {
195196
delete cache[ id ];
196197
} else {
197198
cache[ id ] = null;

0 commit comments

Comments
 (0)