Media manager: Avoid a blank modal when an invalid image size class is set on the image.

props gcorne.
fixes #24409.

Built from https://develop.svn.wordpress.org/trunk@27687


git-svn-id: http://core.svn.wordpress.org/trunk@27526 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Andrew Nacin 2014-03-24 19:01:15 +00:00
parent a6b9d323c6
commit c4aab42b4b
2 changed files with 6 additions and 1 deletions

View File

@ -448,6 +448,11 @@ window.wp = window.wp || {};
}
size = this.attachment.get( 'sizes' )[ this.get( 'size' ) ];
if ( ! size ) {
return;
}
this.set( 'url', size.url );
this.set( 'width', size.width );
this.set( 'height', size.height );

File diff suppressed because one or more lines are too long