check if lang is empty

This commit is contained in:
adbenitez 2025-05-26 17:37:06 +02:00
parent f8d0fd3f77
commit cfdfab1716

View file

@ -630,7 +630,7 @@ public class WebxdcActivity extends WebViewActivity implements DcEventCenter.DcE
@JavascriptInterface
public void ttsSpeak(String text, String lang) {
tts.setLanguage(Locale.forLanguageTag(lang));
if (lang != null && !lang.isEmpty()) tts.setLanguage(Locale.forLanguageTag(lang));
tts.speak(text, TextToSpeech.QUEUE_FLUSH, null, null);
}