Commit 597b7a5f authored by spdonghao's avatar spdonghao Committed by Commit Bot

Add a null check in LayoutManagerChromePhone#tabCreating.

Allow active layout to be null in LayoutManagerChromePhone#tabCreating.

Bug: 1140406
Change-Id: Ic4104a29689892bbe9101ad3f7d3b4d4018aaece
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2527684Reviewed-by: default avatarXi Han <hanxi@chromium.org>
Reviewed-by: default avatarMatthew Jones <mdjones@chromium.org>
Reviewed-by: default avatarWei-Yin Chen (陳威尹) <wychen@chromium.org>
Commit-Queue: Hao Dong <spdonghao@chromium.org>
Cr-Commit-Position: refs/heads/master@{#825871}
parent 82c79b1f
......@@ -135,8 +135,8 @@ public class LayoutManagerChromePhone extends LayoutManagerChrome {
@Override
protected void tabCreating(int sourceId, String url, boolean isIncognito) {
if (!getActiveLayout().isStartingToHide() && overlaysHandleTabCreating()
&& getActiveLayout().handlesTabCreating()) {
if (getActiveLayout() != null && !getActiveLayout().isStartingToHide()
&& overlaysHandleTabCreating() && getActiveLayout().handlesTabCreating()) {
// If the current layout in the foreground, let it handle the tab creation animation.
// This check allows us to switch from the StackLayout to the SimpleAnimationLayout
// smoothly.
......@@ -151,9 +151,11 @@ public class LayoutManagerChromePhone extends LayoutManagerChrome {
startShowing(mSimpleAnimationLayout, false);
}
}
if (getActiveLayout() != null) {
getActiveLayout().onTabCreating(sourceId);
}
}
}
/** @return Whether the {@link SceneOverlay}s handle tab creation. */
private boolean overlaysHandleTabCreating() {
......
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