From e3a9a11840e2706a72ac23f8248ec935262fbe3f Mon Sep 17 00:00:00 2001 From: Abijeet Date: Tue, 28 Sep 2021 15:23:49 +0530 Subject: [PATCH] ULS LCD: Check if region exists before adding languages The regions displayed on ULS depend on the showRegions parameter passed to uls.lcd plugin. If a new language and region have been added to the language data, the region for it will not be available to showRegion because it's static. Bug: T187553 --- src/jquery.uls.lcd.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/jquery.uls.lcd.js b/src/jquery.uls.lcd.js index 39a6402..7b54213 100644 --- a/src/jquery.uls.lcd.js +++ b/src/jquery.uls.lcd.js @@ -98,7 +98,9 @@ } for ( i = 0; i < regions.length; i++ ) { - this.regionLanguages[ regions[ i ] ].push( langCode ); + if ( this.regionLanguages[ regions[ i ] ] ) { + this.regionLanguages[ regions[ i ] ].push( langCode ); + } } // Work around the bad interface, delay rendering until we have got