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

Commit ddb96df9 authored by Filip Gruszczynski's avatar Filip Gruszczynski
Browse files

Fix NPE when checking if recents should be launched in docked mode.

In some cases the activity starting method might return early with
positive return code, even though it skipped doing most of the work
and the target stack is not set. We need to protect ourselves from
an NPE in that case.

Bug: 26541093

Change-Id: I7227ad8efa30c52dd8178ad3c9d8b2263c89a74f
parent e5480cc5
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -1034,7 +1034,8 @@ class ActivityStarter {
    }

    private void launchRecentsAppIfNeeded(ActivityStack topStack) {
        if (topStack.mStackId == HOME_STACK_ID && mTargetStack.mStackId == DOCKED_STACK_ID) {
        if (topStack.mStackId == HOME_STACK_ID && mTargetStack != null
                && mTargetStack.mStackId == DOCKED_STACK_ID) {
            // We launch an activity while being in home stack, which means either launcher or
            // recents into docked stack. We don't want the launched activity to be alone in a
            // docked stack, so we want to immediately launch recents too.