Fix issue: search strings like 't', 'a' are not giving results
There are languges starting with those letters, but without autonyms Add a null check for undefined autonyms to prevent js error Change-Id: I88a1d79b3bb23beac7238c1e8817cd6eac614613
This commit is contained in:
@@ -163,7 +163,7 @@
|
|||||||
suggestion = userInput + languageName.substring( userInput.length, languageName.length );
|
suggestion = userInput + languageName.substring( userInput.length, languageName.length );
|
||||||
if ( suggestion !== languageName ) {
|
if ( suggestion !== languageName ) {
|
||||||
// see if it was autonym match
|
// see if it was autonym match
|
||||||
autonym = $.uls.data.autonym( langCode );
|
autonym = $.uls.data.autonym( langCode ) || '';
|
||||||
suggestion = userInput + autonym.substring( userInput.length, autonym.length );
|
suggestion = userInput + autonym.substring( userInput.length, autonym.length );
|
||||||
if ( suggestion !== autonym ) {
|
if ( suggestion !== autonym ) {
|
||||||
// Give up. It may be iso/script code match.
|
// Give up. It may be iso/script code match.
|
||||||
|
|||||||
Reference in New Issue
Block a user