commit | 52344a0788db20d12960b2481e99e990c3de1ea4 | [log] [tgz] |
---|---|---|
author | Ken Wakasa <kwakasa@google.com> | Thu Jun 23 22:51:05 2011 +0900 |
committer | Ken Wakasa <kwakasa@google.com> | Fri Jun 24 15:31:09 2011 +0900 |
tree | 5f3fed92b64ef078bd9afec21b9d9b5358d681ce | |
parent | 2442e779857e7eda253aadcb1c4dff5ccb3e53f4 [diff] |
Fix NPE with the unit test Change-Id: I0836f8b7191287bcff65cdc8a8ce0ff7484e9f65
diff --git a/java/src/com/android/inputmethod/keyboard/LatinKeyboard.java b/java/src/com/android/inputmethod/keyboard/LatinKeyboard.java index 76eac1a..00bf348 100644 --- a/java/src/com/android/inputmethod/keyboard/LatinKeyboard.java +++ b/java/src/com/android/inputmethod/keyboard/LatinKeyboard.java
@@ -140,7 +140,7 @@ // The threshold is "key width" x 1.25 mSpacebarLanguageSwitchThreshold = (getMostCommonKeyWidth() * 5) / 4; - if (mSpaceKey != null) { + if (mSpaceKey != null && mSpacePreviewIcon != null) { final int slidingIconWidth = Math.max(mSpaceKey.mWidth, (int)(getMinWidth() * SPACEBAR_POPUP_MIN_RATIO)); final int spaceKeyheight = mSpacePreviewIcon.getIntrinsicHeight();