Merge "Fix NPE when converting final screen to empty screen." into sc-qpr1-dev

This commit is contained in:
TreeHugger Robot
2021-08-19 15:30:20 +00:00
committed by Android (Google) Code Review

View File

@@ -687,8 +687,9 @@ public class Workspace extends PagedView<WorkspacePageIndicator>
CellLayout finalScreen = mWorkspaceScreens.get(finalScreenId);
// If the final screen is empty, convert it to the extra empty screen
if (finalScreen.getShortcutsAndWidgets().getChildCount() == 0 &&
!finalScreen.isDropPending()) {
if (finalScreen != null
&& finalScreen.getShortcutsAndWidgets().getChildCount() == 0
&& !finalScreen.isDropPending()) {
mWorkspaceScreens.remove(finalScreenId);
mScreenOrder.removeValue(finalScreenId);