commit | 4a60d61887a20d349e5eb38900dfbcaab06630fc | [log] [tgz] |
---|---|---|
author | Jean-Michel Trivi <jmtrivi@google.com> | Mon Jul 26 16:11:58 2010 -0700 |
committer | Jean-Michel Trivi <jmtrivi@google.com> | Mon Jul 26 16:11:58 2010 -0700 |
tree | a66be9633e9bbaad569087e3a53a724102955b5b | |
parent | 00de721859ca291d0e212a6970f0bd8b3a2f8428 [diff] |
Fix NPE in TextToSpeech with setLanguage(null) getLanguage() can return null, and pass it to setLanguage() in TextToSpeech.initTts() Change-Id: I8046e94959404bd63b0a90bcc2dbf4018f77c110
diff --git a/core/java/android/speech/tts/TextToSpeech.java b/core/java/android/speech/tts/TextToSpeech.java index 26c167e..841257f 100755 --- a/core/java/android/speech/tts/TextToSpeech.java +++ b/core/java/android/speech/tts/TextToSpeech.java
@@ -1065,6 +1065,9 @@ if (!mStarted) { return result; } + if (loc == null) { + return result; + } try { String language = loc.getISO3Language(); String country = loc.getISO3Country();