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 { ...@@ -135,8 +135,8 @@ public class LayoutManagerChromePhone extends LayoutManagerChrome {
@Override @Override
protected void tabCreating(int sourceId, String url, boolean isIncognito) { protected void tabCreating(int sourceId, String url, boolean isIncognito) {
if (!getActiveLayout().isStartingToHide() && overlaysHandleTabCreating() if (getActiveLayout() != null && !getActiveLayout().isStartingToHide()
&& getActiveLayout().handlesTabCreating()) { && overlaysHandleTabCreating() && getActiveLayout().handlesTabCreating()) {
// If the current layout in the foreground, let it handle the tab creation animation. // 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 // This check allows us to switch from the StackLayout to the SimpleAnimationLayout
// smoothly. // smoothly.
...@@ -151,7 +151,9 @@ public class LayoutManagerChromePhone extends LayoutManagerChrome { ...@@ -151,7 +151,9 @@ public class LayoutManagerChromePhone extends LayoutManagerChrome {
startShowing(mSimpleAnimationLayout, false); startShowing(mSimpleAnimationLayout, false);
} }
} }
getActiveLayout().onTabCreating(sourceId); if (getActiveLayout() != null) {
getActiveLayout().onTabCreating(sourceId);
}
} }
} }
......
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