Commit 44eaec7c authored by Robert Ogden's avatar Robert Ogden Committed by Commit Bot

Fix web_contents nullptr

Looks like this crash is happening right when the browser starts in some
weird corner case. This CL just exists early if web_contents() is null.

Bug: 876835
Change-Id: I6dc7eecbd42becb077d9156a28974264c4c90166
Reviewed-on: https://chromium-review.googlesource.com/1185898Reviewed-by: default avatarRyan Sturm <ryansturm@chromium.org>
Commit-Queue: Robert Ogden <robertogden@chromium.org>
Cr-Commit-Position: refs/heads/master@{#585377}
parent fe1a9a1f
......@@ -59,6 +59,9 @@ void PreviewsUITabHelper::ShowUIElement(
bool is_data_saver_user,
bool is_reload,
OnDismissPreviewsUICallback on_dismiss_callback) {
if (!web_contents())
return;
// Retrieve PreviewsUIService* from |web_contents| if available.
PreviewsService* previews_service = PreviewsServiceFactory::GetForProfile(
Profile::FromBrowserContext(web_contents()->GetBrowserContext()));
......
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