am 6c034901: Fix an NPE

* commit '6c0349012eb0edad56b6b89defebb922bbddbb34':
  Fix an NPE
This commit is contained in:
Jean Chalard 2012-05-22 20:15:19 -07:00 committed by Android Git Automerger
commit c4f66d3233

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);
}
}