Merge "Protect against JS error when langlinks API query returns an error"

This commit is contained in:
jenkins-bot 2014-01-08 15:19:02 +00:00 committed by Gerrit Code Review
commit d5b51e5204

View file

@ -95,7 +95,8 @@ ve.ui.MWLanguagesPage.prototype.onLoadLanguageData = function ( languages ) {
* Handle language items being loaded.
*/
ve.ui.MWLanguagesPage.prototype.onAllLanguageItemsSuccess = function ( deferred, response ) {
var i, iLen, languages = [], langlinks = response.visualeditor.langlinks;
var i, iLen, languages = [],
langlinks = response && response.visualeditor && response.visualeditor.langlinks;
if ( langlinks ) {
for ( i = 0, iLen = langlinks.length; i < iLen; i++ ) {
languages.push( {