Skip to content

Commit 59eb691

Browse files
hyperb1issJean-Baptiste Queru
authored andcommitted
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
1 parent c6f8ea4 commit 59eb691

File tree

1 file changed

+10
-6
lines changed

1 file changed

+10
-6
lines changed

core/java/android/inputmethodservice/InputMethodService.java

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1981,15 +1981,19 @@ public void onUpdateExtractingViews(EditorInfo ei) {
19811981
ei.inputType != InputType.TYPE_NULL);
19821982
if (hasAction) {
19831983
mExtractAccessories.setVisibility(View.VISIBLE);
1984-
if (ei.actionLabel != null) {
1985-
mExtractAction.setText(ei.actionLabel);
1986-
} else {
1987-
mExtractAction.setText(getTextForImeAction(ei.imeOptions));
1984+
if (mExtractAction != null) {
1985+
if (ei.actionLabel != null) {
1986+
mExtractAction.setText(ei.actionLabel);
1987+
} else {
1988+
mExtractAction.setText(getTextForImeAction(ei.imeOptions));
1989+
}
1990+
mExtractAction.setOnClickListener(mActionClickListener);
19881991
}
1989-
mExtractAction.setOnClickListener(mActionClickListener);
19901992
} else {
19911993
mExtractAccessories.setVisibility(View.GONE);
1992-
mExtractAction.setOnClickListener(null);
1994+
if (mExtractAction != null) {
1995+
mExtractAction.setOnClickListener(null);
1996+
}
19931997
}
19941998
}
19951999

0 commit comments

Comments
 (0)