Commit 1895b3a2 authored by Yusuf Ozuysal's avatar Yusuf Ozuysal Committed by Commit Bot

Don't destroy members if TabGroupUI isn't initialized

There may be cases where TabGroupUI is constructed and then destroyed
wihtout calling initWithNative. This is a band-aid fix to address that
and not attempt to destroy members that are not assigned yet. (The
members are not individually checked to make the CL shorter, as we may
need to cherry-pick)

BUG=966769

Change-Id: I991c99c65d024e4115e327f6252810409e512951
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1636456Reviewed-by: default avatarPedro Amaral <amaralp@chromium.org>
Commit-Queue: Yusuf Ozuysal <yusufo@chromium.org>
Cr-Commit-Position: refs/heads/master@{#664587}
parent b8af971f
...@@ -117,6 +117,9 @@ public class TabGroupUiCoordinator ...@@ -117,6 +117,9 @@ public class TabGroupUiCoordinator
*/ */
@Override @Override
public void destroy() { public void destroy() {
// Early return if the component hasn't initialized yet.
if (mActivity == null) return;
mTabStripCoordinator.destroy(); mTabStripCoordinator.destroy();
mTabGridSheetCoordinator.destroy(); mTabGridSheetCoordinator.destroy();
mMediator.destroy(); mMediator.destroy();
......
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