Fix an NPE

Bug: 6538761
Change-Id: Id85486ee93437cfec7db421d5c7f2d7980a7e32e
main
Jean Chalard 2012-05-23 10:27:53 +09:00
parent 37f81cd6e9
commit 6c0349012e
1 changed files with 1 additions and 1 deletions

View File

@ -2299,7 +2299,7 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen
final InputConnection ic = getCurrentInputConnection();
if (null != ic) {
final CharSequence lastChar = ic.getTextBeforeCursor(1, 0);
if (lastChar.length() > 0 && Character.isHighSurrogate(lastChar.charAt(0))) {
if (!TextUtils.isEmpty(lastChar) && Character.isHighSurrogate(lastChar.charAt(0))) {
ic.deleteSurroundingText(1, 0);
}
}