fix dereferencing null pointer

This commit is contained in:
deepak1556 2016-06-08 18:04:03 +05:30
parent d5bb7d7525
commit 414183e0fd

View file

@ -31,10 +31,13 @@ void HandleExternalProtocolInUI(
if (!web_contents)
return;
GURL escaped_url(net::EscapeExternalHandlerValue(url.spec()));
auto callback = base::Bind(&OnOpenExternal, escaped_url);
auto permission_helper =
WebContentsPermissionHelper::FromWebContents(web_contents);
if (!permission_helper)
return;
GURL escaped_url(net::EscapeExternalHandlerValue(url.spec()));
auto callback = base::Bind(&OnOpenExternal, escaped_url);
permission_helper->RequestOpenExternalPermission(callback, has_user_gesture);
}