mirror of
https://github.com/LawnchairLauncher/lawnchair.git
synced 2026-03-04 01:46:49 +00:00
Fix NPE in FolderPagedView
Bug: 282945356 Test: Compilation worked properly. Change-Id: Ice59274ec0979550388c5d8a8f17f6e912d7ccb3
This commit is contained in:
@@ -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;
|
||||
@@ -46,7 +48,6 @@ import com.android.launcher3.keyboard.ViewGroupFocusHelper;
|
||||
import com.android.launcher3.model.data.ItemInfo;
|
||||
import com.android.launcher3.model.data.WorkspaceItemInfo;
|
||||
import com.android.launcher3.pageindicators.PageIndicatorDots;
|
||||
import com.android.launcher3.touch.ItemClickHandler;
|
||||
import com.android.launcher3.util.LauncherBindableItemsContainer.ItemOperator;
|
||||
import com.android.launcher3.util.Thunk;
|
||||
import com.android.launcher3.util.ViewCache;
|
||||
@@ -231,11 +232,13 @@ public class FolderPagedView extends PagedView<PageIndicatorDots> implements Cli
|
||||
return textView;
|
||||
}
|
||||
|
||||
@Nullable
|
||||
@Override
|
||||
public CellLayout getPageAt(int index) {
|
||||
return (CellLayout) getChildAt(index);
|
||||
}
|
||||
|
||||
@Nullable
|
||||
public CellLayout getCurrentCellLayout() {
|
||||
return getPageAt(getNextPage());
|
||||
}
|
||||
@@ -382,7 +385,7 @@ public class FolderPagedView extends PagedView<PageIndicatorDots> implements Cli
|
||||
}
|
||||
|
||||
private View getViewInCurrentPage(ToIntFunction<ShortcutAndWidgetContainer> rankProvider) {
|
||||
if (getChildCount() < 1) {
|
||||
if (getChildCount() < 1 || getCurrentCellLayout() == null) {
|
||||
return null;
|
||||
}
|
||||
ShortcutAndWidgetContainer container = getCurrentCellLayout().getShortcutsAndWidgets();
|
||||
|
||||
Reference in New Issue
Block a user