diff options
author | Jean-Michel Trivi <jmtrivi@google.com> | 2010-07-26 16:11:58 -0700 |
---|---|---|
committer | Jean-Michel Trivi <jmtrivi@google.com> | 2010-07-26 16:11:58 -0700 |
commit | 4a60d61887a20d349e5eb38900dfbcaab06630fc (patch) | |
tree | a66be9633e9bbaad569087e3a53a724102955b5b | |
parent | 00de721859ca291d0e212a6970f0bd8b3a2f8428 (diff) | |
download | frameworks_base-4a60d61887a20d349e5eb38900dfbcaab06630fc.zip frameworks_base-4a60d61887a20d349e5eb38900dfbcaab06630fc.tar.gz frameworks_base-4a60d61887a20d349e5eb38900dfbcaab06630fc.tar.bz2 |
Fix NPE in TextToSpeech with setLanguage(null)
getLanguage() can return null, and pass it to setLanguage()
in TextToSpeech.initTts()
Change-Id: I8046e94959404bd63b0a90bcc2dbf4018f77c110
-rwxr-xr-x | core/java/android/speech/tts/TextToSpeech.java | 3 |
1 files changed, 3 insertions, 0 deletions
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 @@ public class TextToSpeech { if (!mStarted) { return result; } + if (loc == null) { + return result; + } try { String language = loc.getISO3Language(); String country = loc.getISO3Country(); |