Fix crash when activity not attached after search index finishes.

When search indexing completes, check for valid  activity before
proceeding with further operations.

Change-Id: I7c72aa358574f79e2184d60bc9d0241595ea5d3b
Fix: 38198223
Test: make RunSettingsRoboTests
This commit is contained in:
Doris Ling
2017-05-10 11:45:57 -07:00
parent 8fc602fed8
commit c55f9f5625
2 changed files with 20 additions and 0 deletions

View File

@@ -291,6 +291,9 @@ public class SearchFragment extends InstrumentedFragment implements SearchView.O
*/
@Override
public void onIndexingFinished() {
if (getActivity() == null) {
return;
}
if (mShowingSavedQuery) {
mSavedQueryController.loadSavedQueries();
} else {