diff --git a/java/src/com/android/inputmethod/keyboard/KeyboardView.java b/java/src/com/android/inputmethod/keyboard/KeyboardView.java index e31aa8478..2e0683115 100644 --- a/java/src/com/android/inputmethod/keyboard/KeyboardView.java +++ b/java/src/com/android/inputmethod/keyboard/KeyboardView.java @@ -142,7 +142,9 @@ public class KeyboardView extends View implements PointerTracker.DrawingProxy { keyboardView.showKey(msg.arg1, tracker); break; case MSG_DISMISS_KEY_PREVIEW: - keyboardView.mPreviewText.setVisibility(View.INVISIBLE); + if (keyboardView.mPreviewText != null) { + keyboardView.mPreviewText.setVisibility(View.INVISIBLE); + } break; } }