Commit fe12fab5 authored by Peter Kotwicz's avatar Peter Kotwicz Committed by Commit Bot

Fix assert in CustomTabActivityTabProvider#swapTab()

This CL moves the assert after the identity check so that calling
swapTab(null) after removeTab() does not cause the assert to fail.

BUG=1083102

Change-Id: Ib11776451f5b9fef60a9be5e0ee5bd7efc7b790b
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2202695Reviewed-by: default avatarPeter Conn <peconn@chromium.org>
Commit-Queue: Peter Kotwicz <pkotwicz@chromium.org>
Cr-Commit-Position: refs/heads/master@{#770408}
parent ffc5a1e1
......@@ -108,8 +108,8 @@ public class CustomTabActivityTabProvider {
}
public void swapTab(@Nullable Tab tab) {
assert mTab != null : "swapTab shouldn't be called before setInitialTab";
if (mTab == tab) return;
assert mTab != null : "swapTab shouldn't be called before setInitialTab";
mTab = tab;
if (mTab == null) {
for (Observer observer : mObservers) {
......
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