From 59eb69192c47ba53cf2ea412a5fba160f2a7892d Mon Sep 17 00:00:00 2001 From: Steve Kondik Date: Mon, 7 Sep 2009 22:53:34 -0400 Subject: 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 --- .../android/inputmethodservice/InputMethodService.java | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) (limited to 'core/java/android/inputmethodservice') diff --git a/core/java/android/inputmethodservice/InputMethodService.java b/core/java/android/inputmethodservice/InputMethodService.java index 5499bba..f4fbaad 100644 --- a/core/java/android/inputmethodservice/InputMethodService.java +++ b/core/java/android/inputmethodservice/InputMethodService.java @@ -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); + } } } -- cgit v1.1