From 9804c0472e3776d9a82178e1c6b1d4f510deb255 Mon Sep 17 00:00:00 2001 From: Hyunyoung Song Date: Thu, 1 Jul 2021 23:26:57 -0700 Subject: [PATCH] Fix NPE inside dispatchRestoreInstanceState Bug: 192559704 Test: manual Change-Id: I212518ac4a7feddd8e87f4be601332ea62e99313 --- src/com/android/launcher3/allapps/AllAppsContainerView.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/com/android/launcher3/allapps/AllAppsContainerView.java b/src/com/android/launcher3/allapps/AllAppsContainerView.java index d1e643fd9f..f4fa1e5f7a 100644 --- a/src/com/android/launcher3/allapps/AllAppsContainerView.java +++ b/src/com/android/launcher3/allapps/AllAppsContainerView.java @@ -188,11 +188,11 @@ public class AllAppsContainerView extends SpringRelativeLayout implements DragSo Bundle state = (Bundle) sparseArray.get(R.id.work_tab_state_id, null); if (state != null) { int currentPage = state.getInt(BUNDLE_KEY_CURRENT_PAGE, 0); - if (currentPage != 0) { + if (currentPage != 0 && mViewPager != null) { mViewPager.setCurrentPage(currentPage); rebindAdapters(true); } else { - mSearchUiManager.resetSearch(); + reset(true); } }