From b8f98ad014ac6f1d453128f902dba67ebebff1d3 Mon Sep 17 00:00:00 2001
From: Amith Yamasani <yamasani@google.com>
Date: Thu, 28 Jan 2010 12:34:01 -0800
Subject: [PATCH] Fix a crash when starting up LatinIME or changing
 orientation. Bug:2403575

---
 src/com/android/inputmethod/latin/LatinIME.java | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/src/com/android/inputmethod/latin/LatinIME.java b/src/com/android/inputmethod/latin/LatinIME.java
index 5d9b5e91d8..c24268dd7e 100644
--- a/src/com/android/inputmethod/latin/LatinIME.java
+++ b/src/com/android/inputmethod/latin/LatinIME.java
@@ -793,7 +793,9 @@ public class LatinIME extends InputMethodService
         }
         mKeyboardSwitcher.setInputLocale(new Locale(mInputLanguage),
                 getSelectedInputLanguages() != null);
-        mKeyboardSwitcher.setVoiceMode(mEnableVoice, mVoiceOnPrimary);
+        if (mInputView != null) {
+            mKeyboardSwitcher.setVoiceMode(mEnableVoice, mVoiceOnPrimary);
+        }
         mKeyboardSwitcher.makeKeyboards(true);
     }
 
-- 
GitLab