chrome: Fix crash when clicking Reading List sidebar link (fixes issue #3128)
This commit is contained in:
parent
9276dba712
commit
51e8bd9bd8
|
@ -135,6 +135,14 @@ void ChromeBrowserDelegate::AddNewContents(
|
||||||
content::WebContents* ChromeBrowserDelegate::OpenURLFromTab(
|
content::WebContents* ChromeBrowserDelegate::OpenURLFromTab(
|
||||||
content::WebContents* source,
|
content::WebContents* source,
|
||||||
const content::OpenURLParams& params) {
|
const content::OpenURLParams& params) {
|
||||||
|
// |source| may be nullptr when opening a link from chrome UI such as the
|
||||||
|
// Reading List sidebar. In that case we default to using the Browser's
|
||||||
|
// currently active WebContents.
|
||||||
|
if (!source) {
|
||||||
|
source = browser_->tab_strip_model()->GetActiveWebContents();
|
||||||
|
DCHECK(source);
|
||||||
|
}
|
||||||
|
|
||||||
// Return nullptr to cancel the navigation. Otherwise, proceed with default
|
// Return nullptr to cancel the navigation. Otherwise, proceed with default
|
||||||
// chrome handling.
|
// chrome handling.
|
||||||
if (auto delegate = GetDelegateForWebContents(source)) {
|
if (auto delegate = GetDelegateForWebContents(source)) {
|
||||||
|
|
Loading…
Reference in New Issue