From 411fa5909ba3ade6346629b86b398b75e900aa26 Mon Sep 17 00:00:00 2001 From: Jean Chalard Date: Wed, 6 Aug 2014 13:00:05 +0900 Subject: [PATCH] Fix an NPE when running with Keep. Change-Id: Ie703e14bff42d34608f11d0c2d7758950b84c88c --- java/src/com/android/inputmethod/latin/LatinIME.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/java/src/com/android/inputmethod/latin/LatinIME.java b/java/src/com/android/inputmethod/latin/LatinIME.java index c1adc12f9..c7c3aaa18 100644 --- a/java/src/com/android/inputmethod/latin/LatinIME.java +++ b/java/src/com/android/inputmethod/latin/LatinIME.java @@ -776,15 +776,15 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen private void onStartInputInternal(final EditorInfo editorInfo, final boolean restarting) { super.onStartInput(editorInfo, restarting); + if (editorInfo == null) { + Log.e(TAG, "Null EditorInfo in onStartInput()"); + return; + } SettingsValues currentSettingsValues = mSettings.getCurrent(); final boolean isSameInputType = currentSettingsValues.isSameInputType(editorInfo); final boolean hasSameOrientation = currentSettingsValues.hasSameOrientation(getResources().getConfiguration()); mRichImm.clearSubtypeCaches(); - if (editorInfo == null) { - Log.e(TAG, "Null EditorInfo in onStartInput()"); - return; - } final boolean inputTypeChanged = !isSameInputType; final boolean isDifferentTextField = !restarting || inputTypeChanged; if (isDifferentTextField || !hasSameOrientation) {