]> source.dussan.org Git - jquery.git/commitdiff
Ensure cache[id] exists before attempting to delete it. Fixes #10080
authorRick Waldron <waldron.rick@gmail.com>
Wed, 17 Aug 2011 21:49:09 +0000 (17:49 -0400)
committerRick Waldron <waldron.rick@gmail.com>
Wed, 17 Aug 2011 21:49:09 +0000 (17:49 -0400)
src/data.js

index 4f87a355042fe0ead6195dfbfd5ab3fcab62c07f..936cd76b80bc293368dd66ab915536a469f7c295 100644 (file)
@@ -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;