Commit d496e411 authored by Troy Hildebrandt's avatar Troy Hildebrandt Committed by Commit Bot

Fix bottom navigation crash bug on global layout.

When updating the menu item spacing for the Chrome Home bottom
navigation menu, we were checking the length of a potentially null array
so a null check has been added.

Bug: 796185
Change-Id: I1382aace706ad2b0ffb13e9c84bf78efc7284ceb
Reviewed-on: https://chromium-review.googlesource.com/848242
Commit-Queue: Troy Hildebrandt <thildebr@chromium.org>
Reviewed-by: default avatarMatthew Jones <mdjones@chromium.org>
Cr-Commit-Position: refs/heads/master@{#526747}
parent 07fe0b6e
...@@ -225,7 +225,7 @@ public class BottomNavigationMenuView extends LinearLayout implements MenuView { ...@@ -225,7 +225,7 @@ public class BottomNavigationMenuView extends LinearLayout implements MenuView {
* @param layoutHeight Height of the navigation menu's container. * @param layoutHeight Height of the navigation menu's container.
*/ */
public void updateMenuItemSpacingForMinWidth(int layoutWidth, int layoutHeight) { public void updateMenuItemSpacingForMinWidth(int layoutWidth, int layoutHeight) {
if (mButtons.length == 0) return; if (mButtons == null || mButtons.length == 0) return;
int menuWidth = Math.min(layoutWidth, layoutHeight); int menuWidth = Math.min(layoutWidth, layoutHeight);
if (menuWidth != mMenuWidth) { if (menuWidth != mMenuWidth) {
......
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