Commit 51c366aa authored by Theresa Wellington's avatar Theresa Wellington Committed by Commit Bot

[Home] Check for null bottom sheet in BottomToolbarPhone#updateVisuals

BottomToolbarPhone#updateVisualsForToolbarState() is now called from
BottomToolbarPhone#onAttachedToWindow(). We have crash reports
indicating that for some users the bottom sheet is null when the toolbar
is attached to the window. Adding null checks.

BUG=769612

Change-Id: I6dc5e86851b8c054f50e798ac854fff0e3629d43
Reviewed-on: https://chromium-review.googlesource.com/690800Reviewed-by: default avatarMatthew Jones <mdjones@chromium.org>
Commit-Queue: Theresa <twellington@chromium.org>
Cr-Commit-Position: refs/heads/master@{#505135}
parent a1707d03
......@@ -334,7 +334,7 @@ public class BottomToolbarPhone extends ToolbarPhone {
@Override
public boolean isInTabSwitcherMode() {
return !mBottomSheet.isSheetOpen() && super.isInTabSwitcherMode();
return super.isInTabSwitcherMode() && (mBottomSheet == null || !mBottomSheet.isSheetOpen());
}
@Override
......@@ -744,7 +744,7 @@ public class BottomToolbarPhone extends ToolbarPhone {
mExpandButton.setTint(tint);
}
if (mBottomSheet.isSheetOpen()) {
if (mBottomSheet != null && mBottomSheet.isSheetOpen()) {
mShowMenuButtonWhenSheetOpen = mBottomSheet.isShowingNewTab();
updateButtonsContainerVisibilityAndTranslation();
updateMenuButtonClickableState();
......
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