diff --git a/core/java/android/speech/tts/TextToSpeech.java b/core/java/android/speech/tts/TextToSpeech.java index 26c167e1f0133..841257f367701 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();