Commit 1fb673e9 authored by Weidong Guo's avatar Weidong Guo Committed by Commit Bot

Speculative fix for folder crash

Folder crashes during closing animation. |activated_folder_item_view_|
may be nullptr at that time, so fix it by checking nullptr.

BUG=813211

Change-Id: Iff04425a5178d55222195dc44742a83dfe50ae63
Reviewed-on: https://chromium-review.googlesource.com/990714Reviewed-by: default avatarXiyuan Xia <xiyuan@chromium.org>
Commit-Queue: Weidong Guo <weidongg@chromium.org>
Cr-Commit-Position: refs/heads/master@{#547529}
parent dd4ba282
...@@ -159,12 +159,16 @@ class FolderItemTitleAnimation : public gfx::SlideAnimation, ...@@ -159,12 +159,16 @@ class FolderItemTitleAnimation : public gfx::SlideAnimation,
private: private:
// gfx::AnimationDelegate // gfx::AnimationDelegate
void AnimationProgressed(const gfx::Animation* animation) override { void AnimationProgressed(const gfx::Animation* animation) override {
if (!folder_view_->GetActivatedFolderItemView())
return;
folder_view_->GetActivatedFolderItemView()->title()->SetEnabledColor( folder_view_->GetActivatedFolderItemView()->title()->SetEnabledColor(
gfx::Tween::ColorValueBetween(animation->GetCurrentValue(), from_color_, gfx::Tween::ColorValueBetween(animation->GetCurrentValue(), from_color_,
to_color_)); to_color_));
} }
void AnimationEnded(const gfx::Animation* animation) override { void AnimationEnded(const gfx::Animation* animation) override {
if (!folder_view_->GetActivatedFolderItemView())
return;
folder_view_->GetActivatedFolderItemView()->title()->SetEnabledColor( folder_view_->GetActivatedFolderItemView()->title()->SetEnabledColor(
to_color_); to_color_);
folder_view_->RecordAnimationSmoothness(); folder_view_->RecordAnimationSmoothness();
......
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