Skip to content

Commit 85ff3fe

Browse files
Jean-Baptiste QueruAndroid Code Review
authored andcommitted
Merge "Fix an NPE in InputMethodService when mExtractAction is null."
2 parents 2eebf5c + 59eb691 commit 85ff3fe

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)