Commit c39b58aa authored by Mei Liang's avatar Mei Liang Committed by Commit Bot

Fix NPE in TabContext#createCurrentContext

Without a deep dive investigation, I could not tell what is the root
cause of this NPE. This CL adds a null check and skips the null tab to
calm down the crash rate. A TODO is added to remind us to revisit this
NPE.

TBR=wychen@chromium.org

Bug: 1146320
Change-Id: Iaeb5de83bf3fe95c1adafcd973c503acbfcf93aa
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2532867
Commit-Queue: Mei Liang <meiliang@chromium.org>
Reviewed-by: default avatarWei-Yin Chen (陳威尹) <wychen@chromium.org>
Reviewed-by: default avatarYue Zhang <yuezhanggg@chromium.org>
Cr-Commit-Position: refs/heads/master@{#826491}
parent d24bde97
......@@ -216,6 +216,12 @@ public class TabContext {
// add it to a group it belongs to.
for (int i = 0; i < tabModelFilter.getCount(); i++) {
Tab currentTab = tabModelFilter.getTabAt(i);
assert currentTab != null : "currentTab should not be null";
// TODO(crbug.com/1146320): Investigate the NPE.
if (currentTab == null) continue;
List<Tab> relatedTabs = tabModelFilter.getRelatedTabList(currentTab.getId());
if (relatedTabs.size() > 1) {
......
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