Skip to content

Commit

Permalink
Add null check to BottomToolbarMediator#destroy()
Browse files Browse the repository at this point in the history
If the BottomToolbar is destroyed before native is initialized there
will be a null pointer exception. This CL adds a null check to
prevent this.

Bug: 854342
Change-Id: Ic0a82574e87bce7f46b20d3621796fad09c119a5
Reviewed-on: https://chromium-review.googlesource.com/1107053
Commit-Queue: Pedro Amaral <amaralp@chromium.org>
Reviewed-by: Matthew Jones <mdjones@chromium.org>
Cr-Commit-Position: refs/heads/master@{#569407}
  • Loading branch information
Pedro Amaral authored and Commit Bot committed Jun 21, 2018
1 parent 6ca6728 commit 4d25127
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -72,8 +72,8 @@ void setToolbarSwipeHandler(EdgeSwipeHandler swipeHandler) {
*/
public void destroy() {
mFullscreenManager.removeListener(this);
mOverviewModeBehavior.removeOverviewModeObserver(this);
if (mContextualSearchManger != null) mContextualSearchManger.removeObserver(this);
if (mOverviewModeBehavior != null) mOverviewModeBehavior.removeOverviewModeObserver(this);
}

@Override
Expand Down

0 comments on commit 4d25127

Please sign in to comment.