| Index: chrome/browser/ui/ash/chrome_shell_delegate.cc
|
| diff --git a/chrome/browser/ui/ash/chrome_shell_delegate.cc b/chrome/browser/ui/ash/chrome_shell_delegate.cc
|
| index 69d32abc624ee35ef8fc95a03ecbcf37877552e8..e6017cf9956bbf40e93d118bdf1c83cf30d7e1a8 100644
|
| --- a/chrome/browser/ui/ash/chrome_shell_delegate.cc
|
| +++ b/chrome/browser/ui/ash/chrome_shell_delegate.cc
|
| @@ -479,11 +479,17 @@ ash::ShelfDelegate* ChromeShellDelegate::CreateShelfDelegate(
|
| ui::MenuModel* ChromeShellDelegate::CreateContextMenu(
|
| ash::WmShelf* wm_shelf,
|
| const ash::ShelfItem* item) {
|
| - DCHECK(shelf_delegate_);
|
| // Don't show context menu for exclusive app runtime mode.
|
| if (chrome::IsRunningInAppMode())
|
| return nullptr;
|
|
|
| + // No context menu before |shelf_delegate_| is created. This is possible
|
| + // now because CreateShelfDelegate is called by session state change
|
| + // via mojo asynchronously. Context menu could be triggered when the
|
| + // mojo message is still in-fly and crashes.
|
| + if (!shelf_delegate_)
|
| + return nullptr;
|
| +
|
| return LauncherContextMenu::Create(shelf_delegate_, item, wm_shelf);
|
| }
|
|
|
|
|