mirror of
https://github.com/scratchfoundation/scratch-vm.git
synced 2025-07-29 23:49:21 -04:00
Fix crash when language is not a string
This commit is contained in:
parent
bb9ac40252
commit
ac10f5878b
1 changed files with 1 additions and 1 deletions
|
@ -523,7 +523,7 @@ class Scratch3Text2SpeechBlocks {
|
||||||
// Support language names dropped onto the menu via reporter block
|
// Support language names dropped onto the menu via reporter block
|
||||||
// such as a variable containing a language name (in any language),
|
// such as a variable containing a language name (in any language),
|
||||||
// or the translate extension's language reporter.
|
// or the translate extension's language reporter.
|
||||||
const localeForDroppedName = languageNames.nameMap[locale.toLowerCase()];
|
const localeForDroppedName = languageNames.nameMap[locale.toString().toLowerCase()];
|
||||||
if (localeForDroppedName && this.isSupportedLanguage(localeForDroppedName)) {
|
if (localeForDroppedName && this.isSupportedLanguage(localeForDroppedName)) {
|
||||||
stage.textToSpeechLanguage =
|
stage.textToSpeechLanguage =
|
||||||
this._getExtensionLocaleForSupportedLocale(localeForDroppedName);
|
this._getExtensionLocaleForSupportedLocale(localeForDroppedName);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue