Commit 4b494160 authored by danakj's avatar danakj Committed by Commit Bot

Avoid a crash with a hacky null check in GetURLForDebugTrace().

This is called when there's no frame for the WebWidget, which is bad.
Since this is a problem in M71, here's something small for an easy
merge. I have a better fix for at least one case where this can happen
in a follow-up, in which I'll revert this hack.

R=enne@chromium.org

Change-Id: Icbffcad6a0fe74bf1ae47e1d51c65aba844ccc5e
Bug: 896836
Reviewed-on: https://chromium-review.googlesource.com/c/1292711Reviewed-by: default avatarenne <enne@chromium.org>
Commit-Queue: danakj <danakj@chromium.org>
Cr-Commit-Position: refs/heads/master@{#601339}
parent c409c0da
...@@ -2860,6 +2860,10 @@ void WebViewImpl::ShowContextMenu(WebMenuSourceType source_type) { ...@@ -2860,6 +2860,10 @@ void WebViewImpl::ShowContextMenu(WebMenuSourceType source_type) {
WebURL WebViewImpl::GetURLForDebugTrace() { WebURL WebViewImpl::GetURLForDebugTrace() {
WebFrame* main_frame = MainFrame(); WebFrame* main_frame = MainFrame();
// TODO(crbug.com/896836): Avoid a crash in minimal way for merge. But we'll
// avoid it properly in a followup.
if (!main_frame)
return {};
if (main_frame->IsWebLocalFrame()) if (main_frame->IsWebLocalFrame())
return main_frame->ToWebLocalFrame()->GetDocument().Url(); return main_frame->ToWebLocalFrame()->GetDocument().Url();
return {}; return {};
......
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