Commit 616568a6 authored by Tommy Steimel's avatar Tommy Steimel Committed by Commit Bot

Fix nullptr crash in IsSiteMuted

This CL adds a nullptr check in IsSiteMuted to prevent a crash on Mac.

Bug: 797647
Change-Id: Ic36f0fb39f2dbdf49d2bec9e548a4a6e339dc9a2
Reviewed-on: https://chromium-review.googlesource.com/848245Reviewed-by: default avatarMounir Lamouri <mlamouri@chromium.org>
Reviewed-by: default avatarYuri Wiitala <miu@chromium.org>
Commit-Queue: Tommy Steimel <steimel@chromium.org>
Cr-Commit-Position: refs/heads/master@{#526825}
parent f0bd002c
......@@ -452,6 +452,13 @@ void SetSitesMuted(const TabStripModel& tab_strip,
bool IsSiteMuted(const TabStripModel& tab_strip, const int index) {
content::WebContents* web_contents = tab_strip.GetWebContentsAt(index);
// TODO(steimel): Why was this not a problem for AreAllTabsMuted? Is this
// going to be a problem for SetSitesMuted?
// Prevent crashes with null WebContents (https://crbug.com/797647).
if (!web_contents)
return false;
GURL url = web_contents->GetLastCommittedURL();
// chrome:// URLs don't have content settings but can be muted, so just check
......
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