Commit d247eaf7 authored by nancy's avatar nancy Committed by Commit Bot

Fix crostini context menus crash issue.

BUG=1057570

Change-Id: Id1575ae9ff546a3f0d3ecb7353f3f4a60fd7c82e
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2084031Reviewed-by: default avatarDominick Ng <dominickn@chromium.org>
Commit-Queue: Nancy Wang <nancylingwang@chromium.org>
Cr-Commit-Position: refs/heads/master@{#746172}
parent 167904e8
......@@ -232,12 +232,14 @@ void CrostiniApps::GetMenuModel(const std::string& app_id,
if (ShouldShowDisplayDensityMenuItem(app_id, menu_type, display_id)) {
base::Optional<crostini::CrostiniRegistryService::Registration>
registration = registry_->GetRegistration(app_id);
if (registration->IsScaled()) {
AddCommandItem(ash::CROSTINI_USE_HIGH_DENSITY,
IDS_CROSTINI_USE_HIGH_DENSITY, &menu_items);
} else {
AddCommandItem(ash::CROSTINI_USE_LOW_DENSITY,
IDS_CROSTINI_USE_LOW_DENSITY, &menu_items);
if (registration) {
if (registration->IsScaled()) {
AddCommandItem(ash::CROSTINI_USE_HIGH_DENSITY,
IDS_CROSTINI_USE_HIGH_DENSITY, &menu_items);
} else {
AddCommandItem(ash::CROSTINI_USE_LOW_DENSITY,
IDS_CROSTINI_USE_LOW_DENSITY, &menu_items);
}
}
}
......
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