Skip to content

Commit

Permalink
fix(tts): check error before inspecting result (#3415)
Browse files Browse the repository at this point in the history
Otherwise we panic when a res is nil

Signed-off-by: Ettore Di Giacinto <mudler@localai.io>
  • Loading branch information
mudler authored Aug 27, 2024
1 parent 6a6094a commit da3bc80
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions core/backend/tts.go
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,9 @@ func ModelTTS(
Dst: filePath,
Language: &language,
})
if err != nil {
return "", nil, err
}

// return RPC error if any
if !res.Success {
Expand Down

0 comments on commit da3bc80

Please sign in to comment.