Commit d8132736 authored by Jeffrey Kardatzke's avatar Jeffrey Kardatzke Committed by Commit Bot

Fix null deref when generating feedback report

There was a crash report indicating this was a null deref, and the code
clearly shows the calling function can return a null pointer so account
for that case.

Bug: chromium:990507
Test: Builds
Change-Id: I3b78de23dca40637661d1a9619adf9c00593c485
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1733739
Commit-Queue: Jeffrey Kardatzke <jkardatzke@google.com>
Auto-Submit: Jeffrey Kardatzke <jkardatzke@google.com>
Reviewed-by: default avatarAhmed Fakhry <afakhry@chromium.org>
Cr-Commit-Position: refs/heads/master@{#684073}
parent 44ef1fa2
...@@ -34,8 +34,10 @@ GURL GetTargetTabUrl(SessionID session_id, int index) { ...@@ -34,8 +34,10 @@ GURL GetTargetTabUrl(SessionID session_id, int index) {
browser->tab_strip_model()->GetWebContentsAt(index); browser->tab_strip_model()->GetWebContentsAt(index);
if (target_tab) { if (target_tab) {
if (browser->is_devtools()) { if (browser->is_devtools()) {
target_tab = DevToolsWindow::AsDevToolsWindow(target_tab) if (auto* dev_tools_window =
->GetInspectedWebContents(); DevToolsWindow::AsDevToolsWindow(target_tab)) {
target_tab = dev_tools_window->GetInspectedWebContents();
}
} }
if (target_tab) if (target_tab)
return target_tab->GetURL(); return target_tab->GetURL();
......
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