Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 3b6b818c authored by Romain Hunault's avatar Romain Hunault 🚴🏻
Browse files

Merge branch 'fix-npe-1960' into 'master'

Fix issue 1960: Null Pointer Exception in onDestroy of TtsService

See merge request e/apps/espeak-ng!4
parents 4d620ea5 23b59b3c
Loading
Loading
Loading
Loading
+22 −21
Original line number Diff line number Diff line
@@ -94,8 +94,10 @@ public class TtsService extends TextToSpeechService {
        if (mOnLanguagesDownloaded != null) {
            unregisterReceiver(mOnLanguagesDownloaded);
        }
        if (mAsyncExtract != null) {
            mAsyncExtract.cancel(true);
        }
    }

    /**
     * Sets up the native eSpeak engine.
@@ -320,8 +322,7 @@ public class TtsService extends TextToSpeechService {
            }
        }

        if (text.startsWith("<?xml"))
        {
        if (text.startsWith("<?xml")) {
            // eSpeak does not recognise/skip "<?...?>" preprocessing tags,
            // so need to remove these before passing to synthesize.
            text = text.substring(text.indexOf("?>") + 2).trim();