From e46d12927ee2717788248b05f00b751beaf2a02a Mon Sep 17 00:00:00 2001
From: Ken Wakasa <kwakasa@google.com>
Date: Sat, 18 Aug 2012 00:04:33 +0900
Subject: [PATCH] Fix NPE in LatinIME.addToUserHistoryDictionary()

bug: 7007063
Change-Id: Ie3e2f77dcbc597dda0c0df9a970336e5aac0edba
---
 java/src/com/android/inputmethod/latin/LatinIME.java | 1 +
 1 file changed, 1 insertion(+)

diff --git a/java/src/com/android/inputmethod/latin/LatinIME.java b/java/src/com/android/inputmethod/latin/LatinIME.java
index 884e6db298..c20f3a3a95 100644
--- a/java/src/com/android/inputmethod/latin/LatinIME.java
+++ b/java/src/com/android/inputmethod/latin/LatinIME.java
@@ -2001,6 +2001,7 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen
 
     private CharSequence addToUserHistoryDictionary(final CharSequence suggestion) {
         if (TextUtils.isEmpty(suggestion)) return null;
+        if (mSuggest == null) return null;
 
         // If correction is not enabled, we don't add words to the user history dictionary.
         // That's to avoid unintended additions in some sensitive fields, or fields that
-- 
GitLab