mirror of
https://github.com/LawnchairLauncher/lawnchair.git
synced 2026-02-20 11:18:21 +00:00
Add null check for null task in getItemInfo()
* Pass back an empty WorkspaceItemInfo with correct itemType set on it so at least it can be identified if remaining fields are missing. Fixes: 218625473 Test: Wasn't able to repro crash Change-Id: If20d8fa648edf6c210ad5398905bf78e173b23a1
This commit is contained in:
@@ -462,11 +462,15 @@ public class TaskView extends FrameLayout implements Reusable {
|
||||
return getItemInfo(mTask);
|
||||
}
|
||||
|
||||
protected WorkspaceItemInfo getItemInfo(Task task) {
|
||||
ComponentKey componentKey = TaskUtils.getLaunchComponentKeyForTask(task.key);
|
||||
protected WorkspaceItemInfo getItemInfo(@Nullable Task task) {
|
||||
WorkspaceItemInfo stubInfo = new WorkspaceItemInfo();
|
||||
stubInfo.itemType = LauncherSettings.Favorites.ITEM_TYPE_TASK;
|
||||
stubInfo.container = LauncherSettings.Favorites.CONTAINER_TASKSWITCHER;
|
||||
if (task == null) {
|
||||
return stubInfo;
|
||||
}
|
||||
|
||||
ComponentKey componentKey = TaskUtils.getLaunchComponentKeyForTask(task.key);
|
||||
stubInfo.user = componentKey.user;
|
||||
stubInfo.intent = new Intent().setComponent(componentKey.componentName);
|
||||
stubInfo.title = task.title;
|
||||
|
||||
Reference in New Issue
Block a user