fix(tts): check error before inspecting result (#3415)

Otherwise we panic when a res is nil

Signed-off-by: Ettore Di Giacinto <mudler@localai.io>
This commit is contained in:
Ettore Di Giacinto 2024-08-27 17:35:16 +02:00 committed by GitHub
parent 6a6094a58d
commit da3bc8077d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -78,6 +78,9 @@ func ModelTTS(
Dst: filePath,
Language: &language,
})
if err != nil {
return "", nil, err
}
// return RPC error if any
if !res.Success {