Fix NPE

Bug: 4727778
Change-Id: I08f1204d5f77251c197dda7d2b332441f9f7123d
diff --git a/java/src/com/android/inputmethod/keyboard/KeyboardSwitcher.java b/java/src/com/android/inputmethod/keyboard/KeyboardSwitcher.java
index 8657768..1218a5a 100644
--- a/java/src/com/android/inputmethod/keyboard/KeyboardSwitcher.java
+++ b/java/src/com/android/inputmethod/keyboard/KeyboardSwitcher.java
@@ -186,7 +186,7 @@
 
     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.