diff --git a/src/com/android/launcher3/folder/FolderPagedView.java b/src/com/android/launcher3/folder/FolderPagedView.java index 26a1886695..36e5e1b106 100644 --- a/src/com/android/launcher3/folder/FolderPagedView.java +++ b/src/com/android/launcher3/folder/FolderPagedView.java @@ -31,6 +31,8 @@ import android.view.Gravity; import android.view.View; import android.view.ViewDebug; +import androidx.annotation.Nullable; + import com.android.launcher3.AbstractFloatingView; import com.android.launcher3.BubbleTextView; import com.android.launcher3.CellLayout; @@ -230,11 +232,13 @@ public class FolderPagedView extends PagedView implements Cli return textView; } + @Nullable @Override public CellLayout getPageAt(int index) { return (CellLayout) getChildAt(index); } + @Nullable public CellLayout getCurrentCellLayout() { return getPageAt(getNextPage()); } @@ -381,7 +385,7 @@ public class FolderPagedView extends PagedView implements Cli } private View getViewInCurrentPage(ToIntFunction rankProvider) { - if (getChildCount() < 1) { + if (getChildCount() < 1 || getCurrentCellLayout() == null) { return null; } ShortcutAndWidgetContainer container = getCurrentCellLayout().getShortcutsAndWidgets();