From 989699a69003e1af89309692eb88b7611ebe071f Mon Sep 17 00:00:00 2001 From: Keisuke Kuroyanagi Date: Thu, 23 Oct 2014 22:09:08 +0900 Subject: [PATCH] Fix unit tests (InputLogicTestsDeadKeys). Change-Id: I9a3191548aa0a4e674d736bc10845b952fc9a1e8 --- java/src/com/android/inputmethod/event/DeadKeyCombiner.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/java/src/com/android/inputmethod/event/DeadKeyCombiner.java b/java/src/com/android/inputmethod/event/DeadKeyCombiner.java index 9d7cc0561..7b89b043d 100644 --- a/java/src/com/android/inputmethod/event/DeadKeyCombiner.java +++ b/java/src/com/android/inputmethod/event/DeadKeyCombiner.java @@ -218,7 +218,10 @@ public class DeadKeyCombiner implements Combiner { @Nonnull private static Event createEventChainFromSequence(final @Nonnull CharSequence text, @Nonnull final Event originalEvent) { - Event lastEvent = originalEvent; + if (text.length() <= 0) { + return originalEvent; + } + Event lastEvent = null; int codePoint = 0; for (int i = text.length(); i > 0; i -= Character.charCount(codePoint)) { codePoint = Character.codePointBefore(text, i);