Commit 4d251274 authored by Pedro Amaral's avatar Pedro Amaral Committed by Commit Bot

Add null check to BottomToolbarMediator#destroy()

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: default avatarMatthew Jones <mdjones@chromium.org>
Cr-Commit-Position: refs/heads/master@{#569407}
parent 6ca67282
......@@ -72,8 +72,8 @@ class BottomToolbarMediator
*/
public void destroy() {
mFullscreenManager.removeListener(this);
mOverviewModeBehavior.removeOverviewModeObserver(this);
if (mContextualSearchManger != null) mContextualSearchManger.removeObserver(this);
if (mOverviewModeBehavior != null) mOverviewModeBehavior.removeOverviewModeObserver(this);
}
@Override
......
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