From 52344a0788db20d12960b2481e99e990c3de1ea4 Mon Sep 17 00:00:00 2001 From: Ken Wakasa Date: Thu, 23 Jun 2011 22:51:05 +0900 Subject: [PATCH] Fix NPE with the unit test Change-Id: I0836f8b7191287bcff65cdc8a8ce0ff7484e9f65 --- java/src/com/android/inputmethod/keyboard/LatinKeyboard.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/java/src/com/android/inputmethod/keyboard/LatinKeyboard.java b/java/src/com/android/inputmethod/keyboard/LatinKeyboard.java index 76eac1ac8..00bf348f2 100644 --- a/java/src/com/android/inputmethod/keyboard/LatinKeyboard.java +++ b/java/src/com/android/inputmethod/keyboard/LatinKeyboard.java @@ -140,7 +140,7 @@ public class LatinKeyboard extends Keyboard { // 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();