Merge "Fix a NPE caused by a null typedWord" into honeycomb-mr1

This commit is contained in:
Ken Wakasa 2011-03-04 22:14:24 -08:00 committed by Android (Google) Code Review
commit 5ac8546268
2 changed files with 1 additions and 2 deletions

View file

@ -225,7 +225,7 @@ public class ExpandableDictionary extends Dictionary {
/** /**
* Returns the word's frequency or -1 if not found * Returns the word's frequency or -1 if not found
*/ */
public int getWordFrequency(CharSequence word) { protected int getWordFrequency(CharSequence word) {
Node node = searchNode(mRoots, word, 0, word.length()); Node node = searchNode(mRoots, word, 0, word.length());
return (node == null) ? -1 : node.mFrequency; return (node == null) ? -1 : node.mFrequency;
} }

View file

@ -1427,7 +1427,6 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen
private void saveWordInHistory(CharSequence result) { private void saveWordInHistory(CharSequence result) {
if (mWord.size() <= 1) { if (mWord.size() <= 1) {
mWord.reset();
return; return;
} }
// Skip if result is null. It happens in some edge case. // Skip if result is null. It happens in some edge case.