From 9c76844da2c8b8fb7ac2db5279d74f9e4fd5c629 Mon Sep 17 00:00:00 2001 From: satok Date: Thu, 1 Jul 2010 08:42:20 +0900 Subject: [PATCH] Fix NPE on logging words Change-Id: Idb01cc3226a979de656b30e57422bb35b25d13fa --- java/src/com/android/inputmethod/latin/Suggest.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/java/src/com/android/inputmethod/latin/Suggest.java b/java/src/com/android/inputmethod/latin/Suggest.java index 8ef6c07f8..e7b9e5d69 100755 --- a/java/src/com/android/inputmethod/latin/Suggest.java +++ b/java/src/com/android/inputmethod/latin/Suggest.java @@ -197,10 +197,11 @@ public class Suggest implements Dictionary.WordCallback { if (mOriginalWord != null) { mOriginalWord = mOriginalWord.toString(); mLowerOriginalWord = mOriginalWord.toString().toLowerCase(); + LatinImeLogger.onAddSuggestedWord(mOriginalWord.toString(), Suggest.DIC_USER_TYPED); } else { mLowerOriginalWord = ""; } - LatinImeLogger.onAddSuggestedWord(mOriginalWord.toString(), Suggest.DIC_USER_TYPED); + // Search the dictionary only if there are at least 2 characters if (wordComposer.size() > 1) { if (mUserDictionary != null || mContactsDictionary != null) {