Fix NPE where CellLayout is null when removing item out of folder

Fix: 282249989
Test: create a folder of 2 app icons, remove one icon out of folder, no crash
Change-Id: I3c132ec8833c7cb14066cc403c0641d089bab8ab
This commit is contained in:
Fengjiang Li
2023-06-01 15:20:34 -07:00
parent 052045907c
commit d29db8ea4d

View File

@@ -94,6 +94,9 @@ public class LauncherDelegate {
// folder
CellLayout cellLayout = mLauncher.getCellLayout(info.container,
info.screenId);
if (cellLayout == null) {
return;
}
finalItem = info.contents.remove(0);
newIcon = mLauncher.createShortcut(cellLayout, finalItem);
mLauncher.getModelWriter().addOrMoveItemInDatabase(finalItem,