From da3bc8077d0d4257f8f880c1232cba98e255319b Mon Sep 17 00:00:00 2001 From: Ettore Di Giacinto Date: Tue, 27 Aug 2024 17:35:16 +0200 Subject: [PATCH] fix(tts): check error before inspecting result (#3415) Otherwise we panic when a res is nil Signed-off-by: Ettore Di Giacinto --- core/backend/tts.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/core/backend/tts.go b/core/backend/tts.go index 13a851ba1b5f..258882ae4351 100644 --- a/core/backend/tts.go +++ b/core/backend/tts.go @@ -78,6 +78,9 @@ func ModelTTS( Dst: filePath, Language: &language, }) + if err != nil { + return "", nil, err + } // return RPC error if any if !res.Success {