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

git-svn-id: https://develop.svn.wordpress.org/trunk@22530 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Daryl Koopersmith 2012-11-10 09:57:28 +00:00
parent fefaea2cf1
commit 8af2f4674f
1 changed files with 2 additions and 1 deletions

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 );