Commit 6c759b55 authored by phillis's avatar phillis Committed by Commit Bot

DPWA: handle null app case during GetShortcutInfoForApp

App could be a null pointer if registry profile is being deleted.
In this case, we will not attempt to get shortcut info.

Bug: 1113276
Change-Id: I0ff77b56d701e54350763c1fbabd4f43a0c85f4b
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2388892Reviewed-by: default avatarDaniel Murphy <dmurph@chromium.org>
Reviewed-by: default avatarAlexey Baskakov <loyso@chromium.org>
Commit-Queue: Phillis Tang <phillis@chromium.org>
Cr-Commit-Position: refs/heads/master@{#805438}
parent 8b4da353
...@@ -47,7 +47,12 @@ void WebAppShortcutManager::GetShortcutInfoForApp( ...@@ -47,7 +47,12 @@ void WebAppShortcutManager::GetShortcutInfoForApp(
const AppId& app_id, const AppId& app_id,
GetShortcutInfoCallback callback) { GetShortcutInfoCallback callback) {
const WebApp* app = GetWebAppRegistrar().GetAppById(app_id); const WebApp* app = GetWebAppRegistrar().GetAppById(app_id);
DCHECK(app);
// app could be nullptr if registry profile is being deleted.
if (!app) {
std::move(callback).Run(nullptr);
return;
}
// Build a common intersection between desired and downloaded icons. // Build a common intersection between desired and downloaded icons.
auto icon_sizes_in_px = base::STLSetIntersection<std::vector<SquareSizePx>>( auto icon_sizes_in_px = base::STLSetIntersection<std::vector<SquareSizePx>>(
......
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