mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/VisualEditor
synced 2024-11-12 09:09:25 +00:00
Merge "Protect against JS error when langlinks API query returns an error"
This commit is contained in:
commit
d5b51e5204
|
@ -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( {
|
||||
|
|
Loading…
Reference in a new issue