From e110b8bd6419c0557650cae303b623eb1cc5ecfa Mon Sep 17 00:00:00 2001 From: Alex Baker Date: Wed, 13 Mar 2019 16:12:23 -0500 Subject: [PATCH] Fix crash when collapsing search view --- .../java/com/todoroo/astrid/activity/MainActivity.java | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/com/todoroo/astrid/activity/MainActivity.java b/app/src/main/java/com/todoroo/astrid/activity/MainActivity.java index 96f5e9607..f076609fa 100644 --- a/app/src/main/java/com/todoroo/astrid/activity/MainActivity.java +++ b/app/src/main/java/com/todoroo/astrid/activity/MainActivity.java @@ -412,9 +412,15 @@ public class MainActivity extends InjectingAppCompatActivity } else { taskEditFragment.discardButtonClick(); } - } else if (!getTaskListFragment().collapseSearchView()) { - finish(); + return; } + + TaskListFragment taskListFragment = getTaskListFragment(); + if (taskListFragment != null && taskListFragment.collapseSearchView()) { + return; + } + + finish(); } public TaskListFragment getTaskListFragment() {