diff --git a/src/com/android/inputmethod/latin/LatinIME.java b/src/com/android/inputmethod/latin/LatinIME.java
index 5d9b5e91d88ac12d9578922eb4fe93465827e341..c24268dd7ecaef7966a20c6c3733306ca587f076 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);
     }