fix(stage-ui): guard against undefined voices in ElevenLabs listVoices (#1142)

This commit is contained in:
NJX
2026-03-06 13:59:05 +08:00
committed by GitHub
parent 1a5204878d
commit afe8784661
@@ -917,6 +917,10 @@ export const useProvidersStore = defineStore('providers', () => {
...provider.voice(),
})
if (!voices || !Array.isArray(voices)) {
return []
}
// Find indices of Aria and Bill
const ariaIndex = voices.findIndex(voice => voice.name.includes('Aria'))
const billIndex = voices.findIndex(voice => voice.name.includes('Bill'))