Commit 09970040 authored by Christian Dullweber's avatar Christian Dullweber Committed by Commit Bot

Fix crash on tabs without web_contents

It is possible that tabs on Android have no web_contents. Check for
this case to avoid crashing.

Bug: 818265
Change-Id: I803569fedd23510103923e03d6ba9e79457c57f9
Reviewed-on: https://chromium-review.googlesource.com/948488
Commit-Queue: Christian Dullweber <dullweber@chromium.org>
Reviewed-by: default avatarMartin Šrámek <msramek@chromium.org>
Cr-Commit-Position: refs/heads/master@{#540822}
parent c6694686
......@@ -76,6 +76,10 @@ void DeleteNavigationEntries(
const content::NavigationController::DeletionPredicate& predicate) {
for (int i = 0; i < tab_count; i++) {
content::WebContents* web_contents = tab_list->GetWebContentsAt(i);
// TODO(dullweber): Non-loaded tabs on Android don't have a WebContents.
// We need to cleanup their TabState instead.
if (!web_contents)
continue;
content::NavigationController* controller = &web_contents->GetController();
controller->DiscardNonCommittedEntries();
// We discarded pending and transient entries but there could still be
......
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