Skip to content

Commit

Permalink
fix: getVoiceName is null #168
Browse files Browse the repository at this point in the history
  • Loading branch information
jing332 committed Feb 18, 2024
1 parent dd8ab0f commit 6cb18a3
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -231,8 +231,8 @@ class SystemTtsService : TextToSpeechService(), TextToSpeechManager.Listener {

// 调用者指定ID
var ttsId = -1L
if (request.voiceName.isNotEmpty()) {
val voiceSplitList = request.voiceName.split("_")
if (!request.voiceName.isNullOrEmpty()) {
val voiceSplitList = request.voiceName?.split("_") ?: emptyList()
if (voiceSplitList.isEmpty()) {
longToast(R.string.voice_name_bad_format)
voiceSplitList.getOrNull(voiceSplitList.size - 1)?.let { idStr ->
Expand Down

0 comments on commit 6cb18a3

Please sign in to comment.