mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/VisualEditor
synced 2024-11-25 23:05:35 +00:00
Merge "Only display image info if that exists"
This commit is contained in:
commit
bbba650002
|
@ -187,6 +187,10 @@ ve.ui.MWMediaSearchWidget.prototype.onMediaQueryDone = function ( source, data )
|
|||
}
|
||||
|
||||
for ( page in pages ) {
|
||||
// Verify that imageinfo exists
|
||||
// In case it does not, skip the image to avoid errors in
|
||||
// ve.ui.MWMediaResultWidget
|
||||
if ( pages[page].imageinfo && pages[page].imageinfo.length > 0 ) {
|
||||
title = new mw.Title( pages[page].title ).getMainText();
|
||||
if ( !( title in this.titles ) ) {
|
||||
this.titles[title] = true;
|
||||
|
@ -198,6 +202,7 @@ ve.ui.MWMediaSearchWidget.prototype.onMediaQueryDone = function ( source, data )
|
|||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
this.results.addItems( items );
|
||||
};
|
||||
|
|
Loading…
Reference in a new issue