From 8fe595bbe0f784f4a247b79daaaf2d17f675a008 Mon Sep 17 00:00:00 2001 From: "xiyuan@chromium.org" Date: Sat, 25 Jan 2014 00:20:54 +0000 Subject: ash: Fix ShelfLayoutManager::UpdateVisibilityState crash on shutdown. ShelfLayoutManager clears |workspace_controller_| in its PrepareForShutdown during shutdown and the case needs to be handled in UpdateVisibilityState. BUG=334321 Review URL: https://codereview.chromium.org/146703003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@247031 0039d316-1c4b-4281-b951-d872f2087c98 --- ash/shelf/shelf_layout_manager.cc | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'ash/shelf') diff --git a/ash/shelf/shelf_layout_manager.cc b/ash/shelf/shelf_layout_manager.cc index 3f22fce..21fb0b3 100644 --- a/ash/shelf/shelf_layout_manager.cc +++ b/ash/shelf/shelf_layout_manager.cc @@ -311,6 +311,11 @@ ShelfVisibilityState ShelfLayoutManager::CalculateShelfVisibility() { } void ShelfLayoutManager::UpdateVisibilityState() { + // Bail out early when there is no |workspace_controller_|, which happens + // during shutdown after PrepareForShutdown. + if (!workspace_controller_) + return; + if (Shell::GetInstance()->session_state_delegate()->IsScreenLocked()) { SetState(SHELF_VISIBLE); } else { -- cgit v1.1