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

Commit 240b6bf9 authored by Satoshi Kataoka's avatar Satoshi Kataoka
Browse files

Fix possible NPE in IInputMethodWrapper

Bug: 9093124

Change-Id: If62138a85e46f217ad2d3eda140715961006dcdc
parent 7601e31d
Loading
Loading
Loading
Loading
+8 −0
Original line number Diff line number Diff line
@@ -279,6 +279,10 @@ class IInputMethodWrapper extends IInputMethod.Stub
        try {
            InputMethodSession ls = ((IInputMethodSessionWrapper)
                    session).getInternalInputMethodSession();
            if (ls == null) {
                Log.w(TAG, "Session is already finished: " + session);
                return;
            }
            mCaller.executeOrSendMessage(mCaller.obtainMessageIO(
                    DO_SET_SESSION_ENABLED, enabled ? 1 : 0, ls));
        } catch (ClassCastException e) {
@@ -291,6 +295,10 @@ class IInputMethodWrapper extends IInputMethod.Stub
        try {
            InputMethodSession ls = ((IInputMethodSessionWrapper)
                    session).getInternalInputMethodSession();
            if (ls == null) {
                Log.w(TAG, "Session is already finished: " + session);
                return;
            }
            mCaller.executeOrSendMessage(mCaller.obtainMessageO(DO_REVOKE_SESSION, ls));
        } catch (ClassCastException e) {
            Log.w(TAG, "Incoming session not of correct type: " + session, e);