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

Commit 355f1103 authored by Brad Ebinger's avatar Brad Ebinger
Browse files

Null pointer fix for StateMachine

Checks if StateMachine is null before calling callbacks.

Bug-Id: 26176787
Change-Id: I7ee92326e99e18a3b7045ccf098b52acfaff9a15
parent 0a3d3884
Loading
Loading
Loading
Loading
+8 −2
Original line number Diff line number Diff line
@@ -778,8 +778,11 @@ public class StateMachine {
         */
        @Override
        public final void handleMessage(Message msg) {
            mSm.onPreHandleMessage(msg);
            if (!mHasQuit) {
                if (mSm != null) {
                    mSm.onPreHandleMessage(msg);
                }

                if (mDbg) mSm.log("handleMessage: E msg.what=" + msg.what);

                /** Save the current message */
@@ -803,9 +806,12 @@ public class StateMachine {

                // We need to check if mSm == null here as we could be quitting.
                if (mDbg && mSm != null) mSm.log("handleMessage: X");
            }

                if (mSm != null) {
                    mSm.onPostHandleMessage(msg);
                }
            }
        }

        /**
         * Do any transitions