From 78573f2e8a7dbf67e16fa4dd531f33cba0df7ff5 Mon Sep 17 00:00:00 2001 From: Jean Chalard Date: Fri, 15 Jun 2012 02:42:32 +0900 Subject: [PATCH] Fix an NPE This code is temporary until we get rid of this member. Bug: 6662963 Bug: 6667091 Change-Id: I1d970d2a97992507e86c5b94978a2543fe42b375 --- java/src/com/android/inputmethod/latin/LatinIME.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/java/src/com/android/inputmethod/latin/LatinIME.java b/java/src/com/android/inputmethod/latin/LatinIME.java index 3456ce945..b3a0f54b9 100644 --- a/java/src/com/android/inputmethod/latin/LatinIME.java +++ b/java/src/com/android/inputmethod/latin/LatinIME.java @@ -872,7 +872,7 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen if (ProductionFlag.IS_EXPERIMENTAL) { ResearchLogger.latinIME_onDisplayCompletions(applicationSpecifiedCompletions); } - if (mInputAttributes.mApplicationSpecifiedCompletionOn) { + if (null != mInputAttributes && mInputAttributes.mApplicationSpecifiedCompletionOn) { mApplicationSpecifiedCompletions = applicationSpecifiedCompletions; if (applicationSpecifiedCompletions == null) { clearSuggestions(); @@ -1628,7 +1628,7 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen public boolean isSuggestionsRequested() { // TODO: move this method to mSettingsValues - return mInputAttributes.mIsSettingsSuggestionStripOn + return (null != mInputAttributes && mInputAttributes.mIsSettingsSuggestionStripOn) && (mCurrentSettings.isCorrectionOn() || isShowingSuggestionsStrip()); } @@ -1648,7 +1648,7 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen return true; if (!isShowingSuggestionsStrip()) return false; - if (mInputAttributes.mApplicationSpecifiedCompletionOn) + if (null != mInputAttributes && mInputAttributes.mApplicationSpecifiedCompletionOn) return true; return isSuggestionsRequested(); } @@ -1830,7 +1830,7 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen } } - if (mInputAttributes.mApplicationSpecifiedCompletionOn + if ((null != mInputAttributes && mInputAttributes.mApplicationSpecifiedCompletionOn) && mApplicationSpecifiedCompletions != null && index >= 0 && index < mApplicationSpecifiedCompletions.length) { if (mSuggestionsView != null) {