Commit 4d5af776 authored by Weidong Guo's avatar Weidong Guo Committed by Commit Bot

Speculative fix for crash at ChromeAppListModelUpdater::OnItemUpdated

Bug: 894583
Change-Id: I7c1011ab2f8acffbe93b7523c6839f481f733ae7
Reviewed-on: https://chromium-review.googlesource.com/c/1279203Reviewed-by: default avatarXiyuan Xia <xiyuan@chromium.org>
Commit-Queue: Weidong Guo <weidongg@chromium.org>
Cr-Commit-Position: refs/heads/master@{#599371}
parent 70e82f2a
......@@ -521,7 +521,12 @@ void ChromeAppListModelUpdater::OnFolderDeleted(
void ChromeAppListModelUpdater::OnItemUpdated(
ash::mojom::AppListItemMetadataPtr item) {
ChromeAppListItem* chrome_item = FindItem(item->id);
DCHECK(chrome_item);
// Ignore the item if it does not exist. This happens when a race occurs
// between the browser and ash. e.g. An item is removed on browser side while
// there is an in-flight OnItemUpdated() call from ash.
if (!chrome_item)
return;
// Preserve icon once it cannot be modified at ash.
item->icon = chrome_item->icon();
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment