r75034 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r75033‎ | r75034 | r75035 >
Date:20:30, 19 October 2010
Author:hartman
Status:deferred
Tags:
Comment:
Guard against page.imageinfo[0].metadata == null
Modified paths:
  • /branches/MwEmbedStandAlone/modules/AddMedia/searchLibs/mediaWikiSearch.js (modified) (history)

Diff [purge]

Index: branches/MwEmbedStandAlone/modules/AddMedia/searchLibs/mediaWikiSearch.js
@@ -231,7 +231,7 @@
232232 }
233233 };
234234
235 - for( var i=0; i < page.imageinfo[0].metadata.length; i++ ){
 235+ for( var i=0; page.imageinfo[0].metadata && i < page.imageinfo[0].metadata.length; i++ ){
236236 if( page.imageinfo[0].metadata[i].name == 'length' ){
237237 resource.duration = page.imageinfo[0].metadata[i].value;
238238 }

Status & tagging log