commit | 9804c0472e3776d9a82178e1c6b1d4f510deb255 | [log] [tgz] |
---|---|---|
author | Hyunyoung Song <hyunyoungs@google.com> | Thu Jul 01 23:26:57 2021 -0700 |
committer | Hyunyoung Song <hyunyoungs@google.com> | Thu Jul 01 23:26:57 2021 -0700 |
tree | 8252da480ec64519cf7f53627da38d9c221ebdc8 | |
parent | 679f8bb9cae34b8e6c43f6480e2268c4d73d7348 [diff] |
Fix NPE inside dispatchRestoreInstanceState Bug: 192559704 Test: manual Change-Id: I212518ac4a7feddd8e87f4be601332ea62e99313
diff --git a/src/com/android/launcher3/allapps/AllAppsContainerView.java b/src/com/android/launcher3/allapps/AllAppsContainerView.java index d1e643f..f4fa1e5 100644 --- a/src/com/android/launcher3/allapps/AllAppsContainerView.java +++ b/src/com/android/launcher3/allapps/AllAppsContainerView.java
@@ -188,11 +188,11 @@ 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); } }