Commit 9da26acc authored by Alex Newcomer's avatar Alex Newcomer Committed by Commit Bot

cros: Check for layer existence before operating on it.

Fix for a crash that occurs while the AppList is closing. We assume the
layer exists, yet a few optimizations have been implemented which
may result in layers being destroyed when they are no longer needed.

Bug: 994409
Change-Id: I1d99f34c32e18ef70a3784b1e5337c1530cba872
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1761308
Auto-Submit: Alex Newcomer <newcomer@chromium.org>
Reviewed-by: default avatarJun Mukai <mukai@chromium.org>
Commit-Queue: Alex Newcomer <newcomer@chromium.org>
Cr-Commit-Position: refs/heads/master@{#688312}
parent a6f3d993
...@@ -2729,6 +2729,8 @@ void AppsGridView::OnAppListModelStatusChanged() { ...@@ -2729,6 +2729,8 @@ void AppsGridView::OnAppListModelStatusChanged() {
void AppsGridView::SetViewHidden(AppListItemView* view, void AppsGridView::SetViewHidden(AppListItemView* view,
bool hide, bool hide,
bool immediate) { bool immediate) {
if (!view->layer())
return;
ui::ScopedLayerAnimationSettings animator(view->layer()->GetAnimator()); ui::ScopedLayerAnimationSettings animator(view->layer()->GetAnimator());
animator.SetPreemptionStrategy( animator.SetPreemptionStrategy(
immediate ? ui::LayerAnimator::IMMEDIATELY_SET_NEW_TARGET immediate ? ui::LayerAnimator::IMMEDIATELY_SET_NEW_TARGET
......
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