Media: Account for a race condition when deleting an edit gallery frame. see #21390.

git-svn-id: http://core.svn.wordpress.org/trunk@22530 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Daryl Koopersmith 2012-11-10 09:57:28 +00:00
parent 9c20d148b9
commit 944066ef83

View File

@ -740,7 +740,8 @@ window.wp = window.wp || {};
// Create a single-use frame. If the frame is closed,
// then detach it from the DOM and remove the reference.
this.frame.on( 'close', function() {
this.frame.detach();
if ( this.frame )
this.frame.detach();
delete this.frame;
}, this );