diff --git a/java/src/com/android/inputmethod/keyboard/KeyboardSwitcher.java b/java/src/com/android/inputmethod/keyboard/KeyboardSwitcher.java index 8657768ee..1218a5abd 100644 --- a/java/src/com/android/inputmethod/keyboard/KeyboardSwitcher.java +++ b/java/src/com/android/inputmethod/keyboard/KeyboardSwitcher.java @@ -186,7 +186,7 @@ public class KeyboardSwitcher implements SharedPreferences.OnSharedPreferenceCha public void onSizeChanged() { final int width = mInputMethodService.getWindow().getWindow().getDecorView().getWidth(); - if (width == 0) + if (width == 0 || mCurrentId == null) return; mKeyboardWidth = width; // Set keyboard with new width.