Fix for NPE in saveWordInHistory

Bug: 2898207
main
Amith Yamasani 2010-08-05 15:09:04 -07:00
parent d31d814c58
commit 6dea425480
1 changed files with 5 additions and 0 deletions

View File

@ -1394,6 +1394,11 @@ public class LatinIME extends InputMethodService
mWord.reset();
return;
}
// Skip if result is null. It happens in some edge case.
if (TextUtils.isEmpty(result)) {
return;
}
// Make a copy of the CharSequence, since it is/could be a mutable CharSequence
final String resultCopy = result.toString();
TypedWordAlternatives entry = new TypedWordAlternatives(resultCopy,