Fix an NPE

Bug: 6538761
Change-Id: Id85486ee93437cfec7db421d5c7f2d7980a7e32e
This commit is contained in:
Jean Chalard 2012-05-23 10:27:53 +09:00
parent 37f81cd6e9
commit 6c0349012e

View file

@ -2299,7 +2299,7 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen
final InputConnection ic = getCurrentInputConnection(); final InputConnection ic = getCurrentInputConnection();
if (null != ic) { if (null != ic) {
final CharSequence lastChar = ic.getTextBeforeCursor(1, 0); 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); ic.deleteSurroundingText(1, 0);
} }
} }