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

Commit d9ed45d0 authored by Bryce Lee's avatar Bryce Lee
Browse files

Check for source activity's task presence before referencing.

ActivityStarter guards in all other spots for a null task in the
source activity, which can be the case if said activity is finishing.

This changelist adds the same check to the code when processing a
finishing source.

Change-Id: I78c284f45d96348767d06bb6ce0d78d6b77cb0ad
Fixes: 37428712
Test: manual testing & code inspection
Test: go/wm-smoke
parent 0b1b1c43
Loading
Loading
Loading
Loading
+7 −1
Original line number Diff line number Diff line
@@ -1432,7 +1432,13 @@ class ActivityStarter {
                    + "; forcing " + "Intent.FLAG_ACTIVITY_NEW_TASK for: " + mIntent);
            mLaunchFlags |= FLAG_ACTIVITY_NEW_TASK;
            mNewTaskInfo = mSourceRecord.info;
            mNewTaskIntent = mSourceRecord.getTask().intent;

            // It is not guaranteed that the source record will have a task associated with it. For,
            // example, if this method is being called for processing a pending activity launch, it
            // is possible that the activity has been removed from the task after the launch was
            // enqueued.
            final TaskRecord sourceTask = mSourceRecord.getTask();
            mNewTaskIntent = sourceTask != null ? sourceTask.intent : null;
        }
        mSourceRecord = null;
        mSourceStack = null;