From 99302d9b764e451ffb9a52dd8319e7e7a7f3ef58 Mon Sep 17 00:00:00 2001 From: hashcoko Date: Tue, 28 Nov 2023 15:26:18 +0900 Subject: [PATCH] Fix error handling in sayTTS function Signed-off-by: hashcoko --- src/ts/process/tts.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/ts/process/tts.ts b/src/ts/process/tts.ts index 708c9e97..b7718bab 100644 --- a/src/ts/process/tts.ts +++ b/src/ts/process/tts.ts @@ -150,7 +150,8 @@ export async function sayTTS(character:character,text:string) { case 'novelai': { const audioContext = new AudioContext(); if(text === ''){ - alertError(language.errors.emptyText) + alertError(language.errors.emptyText); + break; } const response = await globalFetch(`https://api.novelai.net/ai/generate-voice?text=${text}&voice=-1&seed=${character.naittsConfig.voice}&opus=false&version=${character.naittsConfig.version}`, { method: 'GET',