handle case of null voices list

pull/1476/head
ggurdin 1 year ago
parent 3be53cc398
commit 04f6e7df13
No known key found for this signature in database
GPG Key ID: A01CB41737CBB478

@ -45,8 +45,8 @@ class TtsController {
await tts.awaitSpeakCompletion(true);
final voices = await tts.getVoices;
availableLangCodes = (voices as List)
final voices = (await tts.getVoices) as List?;
availableLangCodes = (voices ?? [])
.map((v) {
// on iOS / web, the codes are in 'locale', but on Android, they are in 'name'
final nameCode = v['name']?.split("-").first;

Loading…
Cancel
Save