From 944066ef83f9ae9c7190d70114e45c83c1f0fea8 Mon Sep 17 00:00:00 2001 From: Daryl Koopersmith Date: Sat, 10 Nov 2012 09:57:28 +0000 Subject: [PATCH] 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 --- wp-includes/js/mce-view.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/wp-includes/js/mce-view.js b/wp-includes/js/mce-view.js index 3078ed7e56..5e838873ae 100644 --- a/wp-includes/js/mce-view.js +++ b/wp-includes/js/mce-view.js @@ -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 );