Merge "Add a link from Latin IME to the dictionary pack."
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();