From 7545868bc8cad0db5bd992e8fcb513b00a433f60 Mon Sep 17 00:00:00 2001 From: Roan Kattouw Date: Fri, 12 Sep 2014 14:43:31 -0700 Subject: [PATCH] Don't return undefined in ve.init.mw.Platform#getLanguageName When the language isn't found, return an empty string instead of undefined. Bug: 70731 Change-Id: Ia28e0d24e57e3a24414e04bee58ec76459665ad4 --- modules/ve-mw/init/ve.init.mw.Platform.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/ve-mw/init/ve.init.mw.Platform.js b/modules/ve-mw/init/ve.init.mw.Platform.js index 0eccee2083..f5cdfb0ea4 100644 --- a/modules/ve-mw/init/ve.init.mw.Platform.js +++ b/modules/ve-mw/init/ve.init.mw.Platform.js @@ -88,7 +88,7 @@ ve.init.mw.Platform.prototype.getLanguageCodes = function () { ve.init.mw.Platform.prototype.getLanguageName = function ( code ) { var languageNames = mw.language.getData( mw.config.get( 'wgUserLanguage' ), 'languageNames' ) || $.uls.data.getAutonyms(); - return languageNames[code]; + return languageNames[code] || ''; }; /**