Check Title.newFromImg produced a valid title with an extension

Bug: T140574
Change-Id: Ia818cebd47b3bce03befc547e5e435cb8b1f2996
This commit is contained in:
Ed Sanders 2016-07-18 13:34:24 +01:00
parent c22a5eeadd
commit 14d9297eb1

View file

@ -180,7 +180,7 @@
link = $link.prop( 'href' ),
alt = $thumb.attr( 'alt' );
if ( !( title.getExtension().toLowerCase() in bs.validExtensions ) ) {
if ( !title || !title.getExtension() || !( title.getExtension().toLowerCase() in bs.validExtensions ) ) {
return;
}