Fix an NPE in InputMethodService when mExtractAction is null.

This happens with certain third-party IMEs.

Fixes: http://code.google.com/p/cyanogenmod/issues/detail?id=231

Change-Id: Idf4349ee9c7c8f73c255745bc65b49ba9b593874
This commit is contained in:
Steve Kondik
2009-09-07 22:53:34 -04:00
committed by Jean-Baptiste Queru
parent c6f8ea4cf2
commit 59eb69192c

View File

@@ -1981,15 +1981,19 @@ public class InputMethodService extends AbstractInputMethodService {
ei.inputType != InputType.TYPE_NULL);
if (hasAction) {
mExtractAccessories.setVisibility(View.VISIBLE);
if (ei.actionLabel != null) {
mExtractAction.setText(ei.actionLabel);
} else {
mExtractAction.setText(getTextForImeAction(ei.imeOptions));
if (mExtractAction != null) {
if (ei.actionLabel != null) {
mExtractAction.setText(ei.actionLabel);
} else {
mExtractAction.setText(getTextForImeAction(ei.imeOptions));
}
mExtractAction.setOnClickListener(mActionClickListener);
}
mExtractAction.setOnClickListener(mActionClickListener);
} else {
mExtractAccessories.setVisibility(View.GONE);
mExtractAction.setOnClickListener(null);
if (mExtractAction != null) {
mExtractAction.setOnClickListener(null);
}
}
}