diff --git a/src/wp-includes/js/media-views.js b/src/wp-includes/js/media-views.js index be0ee8fd3f..fd40f31579 100644 --- a/src/wp-includes/js/media-views.js +++ b/src/wp-includes/js/media-views.js @@ -5930,11 +5930,15 @@ render: function() { var self = this, args = arguments; + if ( this.model.attachment && 'pending' === this.model.dfd.state() ) { - // should instead show a spinner when the attachment is new and then add a listener that updates on change this.model.dfd.done( function() { media.view.Settings.AttachmentDisplay.prototype.render.apply( self, args ); self.resetFocus(); + } ).fail( function() { + self.model.attachment = false; + media.view.Settings.AttachmentDisplay.prototype.render.apply( self, args ); + self.resetFocus(); } ); } else { media.view.Settings.AttachmentDisplay.prototype.render.apply( this, arguments );