Fixed NPE in ActivityStarter.updateTaskReturnToType()

Bug: 30834977
Test: Manual testing of condition in bug.
Change-Id: I4b46a380fa0b52d983965dfb056b461c53afcd05
This commit is contained in:
Wale Ogunwale
2016-11-17 10:34:58 -08:00
parent fb3d63ee69
commit cdc0ddca91

View File

@@ -1524,8 +1524,8 @@ class ActivityStarter {
private void updateTaskReturnToType(
TaskRecord task, int launchFlags, ActivityStack focusedStack) {
if (focusedStack != null && focusedStack.isHomeStack() &&
focusedStack.topTask().isOnTopLauncher()) {
if (focusedStack != null && focusedStack.isHomeStack() && focusedStack.topTask() != null
&& focusedStack.topTask().isOnTopLauncher()) {
// Since an on-top launcher will is moved to back when tasks are launched from it,
// those tasks should first try to return to a non-home activity.
// This also makes sure that non-home activities are visible under a transparent