Merge "Add advanced settings screen"
diff --git a/java/src/com/android/inputmethod/latin/LatinIME.java b/java/src/com/android/inputmethod/latin/LatinIME.java
index 29ff2b0..964dd99 100644
--- a/java/src/com/android/inputmethod/latin/LatinIME.java
+++ b/java/src/com/android/inputmethod/latin/LatinIME.java
@@ -1466,14 +1466,17 @@
         // in most cases, suggestion count is 1 when typed word's length is 1, but we do always
         // need to clear the previous state when the user starts typing a word (i.e. typed word's
         // length == 1).
-        if (builder.size() > 1 || typedWord.length() == 1 || typedWordValid
-                || mCandidateView.isShowingAddToDictionaryHint()) {
-            builder.setTypedWordValid(typedWordValid).setHasMinimalSuggestion(correctionAvailable);
-        } else {
-            final SuggestedWords previousSuggestions = mCandidateView.getSuggestions();
-            if (previousSuggestions == mSettingsValues.mSuggestPuncList)
-                return;
-            builder.addTypedWordAndPreviousSuggestions(typedWord, previousSuggestions);
+        if (typedWord != null) {
+            if (builder.size() > 1 || typedWord.length() == 1 || typedWordValid
+                    || mCandidateView.isShowingAddToDictionaryHint()) {
+                builder.setTypedWordValid(typedWordValid).setHasMinimalSuggestion(
+                        correctionAvailable);
+            } else {
+                final SuggestedWords previousSuggestions = mCandidateView.getSuggestions();
+                if (previousSuggestions == mSettingsValues.mSuggestPuncList)
+                    return;
+                builder.addTypedWordAndPreviousSuggestions(typedWord, previousSuggestions);
+            }
         }
         showSuggestions(builder.build(), typedWord);
     }