Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 59eb6919 authored by Steve Kondik's avatar Steve Kondik Committed by Jean-Baptiste Queru
Browse files

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
parent c6f8ea4c
Loading
Loading
Loading
Loading
+10 −6
Original line number Diff line number Diff line
@@ -1981,17 +1981,21 @@ public class InputMethodService extends AbstractInputMethodService {
                ei.inputType != InputType.TYPE_NULL);
        if (hasAction) {
            mExtractAccessories.setVisibility(View.VISIBLE);
            if (mExtractAction != null) {
                if (ei.actionLabel != null) {
                    mExtractAction.setText(ei.actionLabel);
                } else {
                    mExtractAction.setText(getTextForImeAction(ei.imeOptions));
                }
                mExtractAction.setOnClickListener(mActionClickListener);
            }
        } else {
            mExtractAccessories.setVisibility(View.GONE);
            if (mExtractAction != null) {
                mExtractAction.setOnClickListener(null);
            }
        }
    }
    
    /**
     * This is called when, while currently displayed in extract mode, the