aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRick Waldron <waldron.rick@gmail.com>2011-08-17 17:49:09 -0400
committerRick Waldron <waldron.rick@gmail.com>2011-08-17 17:49:09 -0400
commitf44d5e1e815ce63b58264b2f9a764c0b03101cfc (patch)
tree4b381a9e4eb29e7c80716cd07729b24db66608a0
parent1a738cb72fa9f8b7280f15586a68ef9377b18976 (diff)
downloadjquery-f44d5e1e815ce63b58264b2f9a764c0b03101cfc.tar.gz
jquery-f44d5e1e815ce63b58264b2f9a764c0b03101cfc.zip
Ensure cache[id] exists before attempting to delete it. Fixes #10080
-rw-r--r--src/data.js3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/data.js b/src/data.js
index 4f87a3550..936cd76b8 100644
--- a/src/data.js
+++ b/src/data.js
@@ -191,7 +191,8 @@ jQuery.extend({
// Browsers that fail expando deletion also refuse to delete expandos on
// the window, but it will allow it on all other JS objects; other browsers
// don't care
- if ( jQuery.support.deleteExpando || cache != window ) {
+ // Ensure that this id actually exists in `cache` #10080
+ if ( cache[ id ] && ( jQuery.support.deleteExpando || cache != window ) ) {
delete cache[ id ];
} else {
cache[ id ] = null;