Skip to content

Commit

Permalink
Merge pull request #5 from tdurand/patch-1
Browse files Browse the repository at this point in the history
Fix: Crash if TextToSpeech not defined
  • Loading branch information
macdonst authored Jun 1, 2017
2 parents 3e4dde2 + 7b54aa8 commit d9b6691
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/android/SpeechSynthesis.java
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ private boolean isReady() {
* @param status
*/
public void onInit(int status) {
if (status == TextToSpeech.SUCCESS) {
if (mTts != null && status == TextToSpeech.SUCCESS) {
state = SpeechSynthesis.STARTED;
JSONArray voices = new JSONArray();
JSONObject voice;
Expand Down Expand Up @@ -259,4 +259,4 @@ public void onDestroy() {
public void onUtteranceCompleted(String utteranceId) {
fireEndEvent(callbackContext);
}
}
}

0 comments on commit d9b6691

Please sign in to comment.