Fix crash when language is not a string

This commit is contained in:
husqwc 2025-05-29 17:58:27 -04:00 committed by GitHub
parent bb9ac40252
commit ac10f5878b
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -523,7 +523,7 @@ class Scratch3Text2SpeechBlocks {
// Support language names dropped onto the menu via reporter block
// such as a variable containing a language name (in any language),
// 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)) {
stage.textToSpeechLanguage =
this._getExtensionLocaleForSupportedLocale(localeForDroppedName);