Fix NPE with the unit test

Change-Id: I0836f8b7191287bcff65cdc8a8ce0ff7484e9f65
This commit is contained in:
Ken Wakasa 2011-06-23 22:51:05 +09:00
parent 2442e77985
commit 52344a0788

View file

@ -140,7 +140,7 @@ public class LatinKeyboard extends Keyboard {
// The threshold is "key width" x 1.25 // The threshold is "key width" x 1.25
mSpacebarLanguageSwitchThreshold = (getMostCommonKeyWidth() * 5) / 4; mSpacebarLanguageSwitchThreshold = (getMostCommonKeyWidth() * 5) / 4;
if (mSpaceKey != null) { if (mSpaceKey != null && mSpacePreviewIcon != null) {
final int slidingIconWidth = Math.max(mSpaceKey.mWidth, final int slidingIconWidth = Math.max(mSpaceKey.mWidth,
(int)(getMinWidth() * SPACEBAR_POPUP_MIN_RATIO)); (int)(getMinWidth() * SPACEBAR_POPUP_MIN_RATIO));
final int spaceKeyheight = mSpacePreviewIcon.getIntrinsicHeight(); final int spaceKeyheight = mSpacePreviewIcon.getIntrinsicHeight();