Fix crash caused by failed TTS CheckVoiceData.

Bug: 13112824
Change-Id: Idb46e499fc7982eb92b6ed1a88d7a0725896b4ef
diff --git a/src/com/android/settings/tts/TtsEngineSettingsFragment.java b/src/com/android/settings/tts/TtsEngineSettingsFragment.java
index bb5ac7a..25ec1fd 100644
--- a/src/com/android/settings/tts/TtsEngineSettingsFragment.java
+++ b/src/com/android/settings/tts/TtsEngineSettingsFragment.java
@@ -158,12 +158,22 @@
     @Override
     public void onActivityResult(int requestCode, int resultCode, Intent data) {
         if (requestCode == VOICE_DATA_INTEGRITY_CHECK) {
-            mVoiceDataDetails = data;
-            updateVoiceDetails();
+            if (resultCode == TextToSpeech.Engine.CHECK_VOICE_DATA_PASS) {
+                updateVoiceDetails(data);
+            } else {
+                Log.e(TAG, "CheckVoiceData activity failed");
+            }
         }
     }
 
-    private void updateVoiceDetails() {
+    private void updateVoiceDetails(Intent data) {
+        if (data == null){
+            Log.e(TAG, "Engine failed voice data integrity check (null return)" +
+                    mTts.getCurrentEngine());
+            return;
+        }
+        mVoiceDataDetails = data;
+
         if (DBG) Log.d(TAG, "Parsing voice data details, data: " + mVoiceDataDetails.toUri(0));
 
         final ArrayList<String> available = mVoiceDataDetails.getStringArrayListExtra(