Fix NPE when converting final screen to empty screen.

Bug: 194553613
Test: manual
Change-Id: Id29b8574964688f6f6aa96dd5b1b8a4d8b9110c0
This commit is contained in:
Jon Miranda authored and Jonathan Miranda committed 2021-08-16 16:47:11 +00:00
1 parent e52a4e39af
commit 26de7be984
1 file changed
+3 -2
+3 -2
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);