WordPress.org

Make WordPress Core

Ticket #39511: 39511.patch

File 39511.patch, 731 bytes (added by chandrapatel, 5 years ago)
  • src/wp-includes/js/media-views.js

     
    77247724                                disabled = false;
    77257725
    77267726                        // Prevent insertion of attachments if any of them are still uploading
    7727                         disabled = _.some( selection.models, function( attachment ) {
    7728                                 return attachment.get('uploading') === true;
    7729                         });
     7727                        if ( selection && selection.models ) {
     7728                                disabled = _.some( selection.models, function( attachment ) {
     7729                                        return attachment.get('uploading') === true;
     7730                                });
     7731                        }
    77307732
    77317733                        if ( requires.selection && selection && ! selection.length ) {
    77327734                                disabled = true;