Commit 857f5dad authored by Sinan Sahin's avatar Sinan Sahin Committed by Commit Bot

[Offline indicator v2] Fix NPE after tab modal dismiss

A runnable is set to run once the slide-in show animation is complete.
However, the show animation is never run if a tab modal dialog is shown.
Once the dialog is dismissed after the status indicator is hidden
(though it was never really shown), the runnable ends up running and
tries to access the model, which is null.

The fix is to check that the indicator has a positive height in addition
to checking that the current min-height offset is equal to the height.
This makes sure we don't run the mOnShowAnimationEnd runnable after the
status indicator is hidden.

Bug: 1122906
Change-Id: I1a0a7d9ef231b198de1ee96fd9af89602ede03e4
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2382874Reviewed-by: default avatarMatthew Jones <mdjones@chromium.org>
Reviewed-by: default avatarTheresa  <twellington@chromium.org>
Commit-Queue: Sinan Sahin <sinansahin@google.com>
Cr-Commit-Position: refs/heads/master@{#804104}
parent e97a414a
......@@ -388,7 +388,8 @@ class StatusIndicatorMediator
mModel.set(StatusIndicatorProperties.CURRENT_VISIBLE_HEIGHT, topControlsMinHeightOffset);
final boolean isCompletelyShown = topControlsMinHeightOffset == mIndicatorHeight;
final boolean isCompletelyShown =
indicatorVisible && topControlsMinHeightOffset == mIndicatorHeight;
// If we're running the animations in native, the Android view should only be visible when
// the indicator is fully shown. Otherwise, the Android view will be visible if it's within
// screen boundaries.
......
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