Fixed NPE by guarding the reference of variable

Bug: 2395174
This commit is contained in:
Tadashi G. Takaoka
2010-03-03 16:15:13 +09:00
parent 0b49ab5cae
commit d9894bc3b3

View File

@@ -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();