From d9894bc3b3d9db952988140613c1186e8990d7c0 Mon Sep 17 00:00:00 2001 From: "Tadashi G. Takaoka" Date: Wed, 3 Mar 2010 16:15:13 +0900 Subject: [PATCH] Fixed NPE by guarding the reference of variable Bug: 2395174 --- .../java/com/android/server/InputMethodManagerService.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/services/java/com/android/server/InputMethodManagerService.java b/services/java/com/android/server/InputMethodManagerService.java index 34113cf40e138..60813f1f6d2a7 100644 --- a/services/java/com/android/server/InputMethodManagerService.java +++ b/services/java/com/android/server/InputMethodManagerService.java @@ -1526,6 +1526,9 @@ public class InputMethodManagerService extends IInputMethodManager.Stub mDialogBuilder.setSingleChoiceItems(mItems, checkedItem, new AlertDialog.OnClickListener() { public void onClick(DialogInterface dialog, int which) { + if (mIms == null) { + return; + } synchronized (mMethodMap) { InputMethodInfo im = mIms[which]; hideInputMethodMenu();