Bug 1701234 - Add more null check on the background thread. r=geckoview-reviewers,agi

Even if landing bug 1697683, this NullPointerException occurs on the
background thread. So I would like to add more null check for this crash.

Differential Revision: https://phabricator.services.mozilla.com/D132329
This commit is contained in:
Makoto Kato 2021-11-30 04:29:09 +00:00
Родитель 6f9c143d3d
Коммит e3ff6e435d
1 изменённых файлов: 4 добавлений и 0 удалений

Просмотреть файл

@ -65,6 +65,10 @@ public class SpeechSynthesisService {
@Override
public void run() {
final TextToSpeech tss = getTTS();
if (tss == null) {
Log.w(LOGTAG, "TextToSpeech is not initialized");
return;
}
final Locale defaultLocale =
Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN_MR2
? tss.getDefaultLanguage()