From 6c0349012eb0edad56b6b89defebb922bbddbb34 Mon Sep 17 00:00:00 2001 From: Jean Chalard Date: Wed, 23 May 2012 10:27:53 +0900 Subject: [PATCH] Fix an NPE Bug: 6538761 Change-Id: Id85486ee93437cfec7db421d5c7f2d7980a7e32e --- java/src/com/android/inputmethod/latin/LatinIME.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/java/src/com/android/inputmethod/latin/LatinIME.java b/java/src/com/android/inputmethod/latin/LatinIME.java index 139eb46ca..83658f77e 100644 --- a/java/src/com/android/inputmethod/latin/LatinIME.java +++ b/java/src/com/android/inputmethod/latin/LatinIME.java @@ -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); } }